#1
|
||||
|
||||
![]()
I'm outputting to multiple files based on a Data field "AccountNo".
Problem is I can have 2 or more people with the same accountNo that live in the same location. So is there a way to keep it unique and not overwrite itself. Maybe add a "_1 or _2 or _3" depending on how many times the same account number comes up. FusionPro.Composition.outputFileName = Field("AccountNo") + ".pdf";
__________________
Kal Bedi FusionPro Desktop 10.1.9 Adobe Acrobat Pro DC Mac OS Sierra 10.12.5 Canada |
#2
|
||||
|
||||
![]()
You could do it by tracking how many times each account number has been used by adding them to a global object:
JavaScript Globals Code:
var accounts = {}; Code:
var FP = FusionPro.Composition; var accountNumber = Field('AccountNo'); if (!accounts[accountNumber]) { accounts[accountNumber] = 1; } else { accountNumber += '_' + ++accounts[accountNumber]; } FP.OpenNewOutputFile(accountNumber + '.' + FP.outputFormatExtension);
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|