Jump to content

Using an external file to insert code into a rule


jmerrick0657

Recommended Posts

I have about 30 FusionPro documents (and growing) that all use the same list of addresses.

I put a for loop in the OnRecordStart rule that cycles through the list and assigns the addresses to different variable to be used throughout the document.

All of these FusionPro documents are hosted on a web to print system; so when there is a change to the address list I end up going through each of the files, update the loop, collect, and re-upload into my web to print system.

 

 

Is it possible to reference an external text file and insert the contents into a rule?

 

 

I'm thinking if I can put the for loop in a text file on my web server and somehow reference it via URL in my OnRecordStart rule, I would only need to update the text file on the web server, and the 30 documents would automatically be updated without having to do anything to them individually.

 

 

Thanks,

Jake Merrick

Link to comment
Share on other sites

Is it possible to reference an external text file and insert the contents into a rule?

Sure, you can have each template point to the same external data file (XDF) that contains the addresses. If the XDF is in a known location on the network, then each template can access it by a UNC path, and any changes to the XDF will be picked up when any new composition is run. I don't know enough about the templates, nor about your network configuration, to be able to suggest any specific code, but I imagine something like this:

var addressFile = new ExternalDataFileEx("\\\\server\\share\\folderpath\\addresses.txt");

Then you can access the data from there.

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...