Jump to content

FusionPro 8 and JavaScript


Recommended Posts

hello all,

Recently upgraded to FP8 and am now experiencing some issues with an older template. Can someone help me fix this code:

 

lf = ReplaceSubstring(FusionPro.Composition.inputFileName, "Requests", "Response");
ResponseFile = new File(lf);
ResponseFile.open();
pl = ReplaceSubstring(FusionPro.Composition.inputFileName, "MaterialRequests", "PickList");
pltxt = ReplaceSubstring(pl, ".2100", ".txt");
PickList = new File(pltxt);
PickList.open();

 

FP is telling me that "File" is not defined. Any and all help would be greatly appreciated.

 

Guy

Link to comment
Share on other sites

  • 2 weeks later...

The File object was removed in FusionPro 8. Its two main purposes, to open secondary data files and to repeat records, have been obviated by the ExternalDataFileEx object and the FusionPro.Composition.repeatRecordCount property, respectively. It was also a potential security risk.

 

At any rate, I don't see any references to the ResponseFile object in your code after opening the file. What were you doing with it in your job? Maybe I can think of another way to accomplish whatever that was.

Link to comment
Share on other sites

Dan,

This is a portion of the OnJobStart rule for this particular daily job. I create a ResponseFile for the customer that regurgitates info into a text file that we supply to the customer for reporting purposes. These jobs (we do many) are automated and having the ability to create the file directly in FusionPro is extremely important to our success as a vendor.

 

Is it possible to create a file using ExternalDataFileEx?

 

I can't seem to attach a zip file of this project (it's 18mb - i receive the following error: Your submission could not be processed because a security token was missing.) If it would be easier to talk in person, please call my cell at 317.900.0774 (I might be a geek, but sometimes it's just easier to talk!)

Link to comment
Share on other sites

Dan,

This is a portion of the OnJobStart rule for this particular daily job. I create a ResponseFile for the customer that regurgitates info into a text file that we supply to the customer for reporting purposes. These jobs (we do many) are automated and having the ability to create the file directly in FusionPro is extremely important to our success as a vendor.

Can you post an example of what this text file looks like? You might be able to use the XML Log File instead. You can call FusionPro.Composition.CreateXMLLogFile and then FusionPro.Composition.LogXMLMetadata to add custom metadata.

 

Another possibility might be a custom JavaScript plug-in. That would be a custom engineering project. You can contact Sales for a quote.

 

The other thing to consider, especially if this is part of an automated workflow utilizing FusionPro Producer (Server), is to have some other part of the application write out this file, and let FusionPro just compose the main output file.

Is it possible to create a file using ExternalDataFileEx?

No, it only reads files.

I can't seem to attach a zip file of this project (it's 18mb - i receive the following error: Your submission could not be processed because a security token was missing.) If it would be easier to talk in person, please call my cell at 317.900.0774 (I might be a geek, but sometimes it's just easier to talk!)

I'm not sure why the file can't be attached. It might be too large for the forum. Also, I'm not able to provide one-on-one help offline, unless the request goes through proper Support channels.

Link to comment
Share on other sites

  • 3 weeks later...
Can the XML log file method create text files? In some instances I read from a mailfile combined with data from an ExternalDataFile to create a new inputFile at the RunTime ... once again, daily automated work that I would rather not have to potentially any manual steps such as renaming an input file.
Link to comment
Share on other sites

Can the XML log file method create text files?

No, it only creates an XML file with a specific format. You can add your own metadata to it on a per-record basis, however. You can also write lines to the main composition log (.msg) file with the Print() function.

In some instances I read from a mailfile combined with data from an ExternalDataFile to create a new inputFile at the RunTime ... once again, daily automated work that I would rather not have to potentially any manual steps such as renaming an input file.

FusionPro VDP wasn't designed to take input data and transform it to a different plain-text format. It's a composition/typesetting engine targeted for variable data printing, not a database merge tool. The word "automated" suggests a workflow where FusionPro VDP Producer (FP Server) is integrated into a larger application, which can perform whatever kind of data manipulation you need.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...