Jump to content

Error in OnNewOutputfile Callback Rule


Recommended Posts

I am using FusionPro Desktop 7.1. I have created the following OnNewOutputfile Callback rule:

 

var new_file_name = 'BusinessCard_' + Field("Name") + '.pdf';

FusionPro.Composition.outputFileName = new_file_name;

return 0;

 

Every time I compose the template, I receive the following error and the output file is not named properly:

 

OnNewOutputFile, line 1: Error: In Field(), no data source defined or data could not be loaded

 

If I remove the field reference from the rule, I do not get the error. I only get the error with the field referenced in the rule. What am I doing wrong?

Link to comment
Share on other sites

It doesn't appear to just be a reporting error since my output file is not being named properly. The output file is being named "Data-Output.pdf" instead of what the rule is telling it to name the file. I'm not outputting multiple records, I'm only outputting one. The "Output to multiple files" option is greyed out.
Link to comment
Share on other sites

It doesn't appear to just be a reporting error since my output file is not being named properly.

No, it is a reporting error, as mentioned in that other case I linked to. Trust me, I know this code. ;)

The output file is being named "Data-Output.pdf" instead of what the rule is telling it to name the file. I'm not outputting multiple records, I'm only outputting one.

Like I said, unless you have that "Output to multiple files" box checked, then the OnNewOutputFile callback has absolutely no effect on your output. This is by design. There is no "new output file" being created in this case; it's just whatever name you specify in the Output tab.

The "Output to multiple files" option is greyed out.

If you're using FusionPro Designer, you can only output one record, by definition, so the options to output multiple files, and therefore to rename your multiple output files, are disabled. You need FusionPro Desktop, Direct, or Server to be able to output multiple files.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...