Hello, I recently created some code for a project that I pieced together from other posts on this forum and I was wondering if you (the community) could take a look at it. I am trying to fine tune it and get a better understanding of all the cool things FusionPro can do.
Background Information
The job had 1,180 unique Order Numbers, 25 records per order number, 29,500 records total. It was 8.5 x 11 and imposed 2up on 11 x 17 duplex. I put them into stacks of 25. Two order numbers per output file.
My Issue
I was outputting just the Order Number.pdf and I wanted more information in the file name.
So I wrote this code (took me awhile to figure this out) I would like to thank Step and Dan Korn, I have read a few of their posts and borrowed code trying to figure this out.
OnNewOutputFile Callback Rule
var CurrentOrderNumber
var NextOrderNumber
var ex = new ExternalDataFileEx(PrimaryInputFile());
var rec = FusionPro.Composition.inputRecordNumber+25;
CurrentOrderNumber = Field("Order_Number")
NextOrderNumber = ex.GetFieldValue(rec, 0);
FusionPro.Composition.OpenNewOutputFile(CurrentOrderNumber + "_" + NextOrderNumber + "." + FusionPro.Composition.outputFormatExtension);
Success, I got the results I wanted.
It took me awhile to figure out the GetFieldValue(record, FieldNameOrNumber) section. My input file was Tab Delimited so I wasn't sure how to use the ExternalDataFileEx(FileName,Delimiter) correctly and I don't think my FieldNames loaded properly so I ended up using FieldNumbers. Is there another way to call your current input file or is ExternalDataFileEx then PrimaryInputFile the only way to go?
Thank you for your time. I had a lot of fun getting this far. I look forward to learning more about this.