Jump to content

Automate field insertion for many variables


Recommended Posts

I am looking to see if there is a way, perhaps with some variation on the FusionPro.Fields/AddVariable examples on the forum, to automatically insert a few hundred variables into four pages of price lists.

 

The catch is, the client says the field names do not stay the same. So right now they have a monthly process of having to manually insert the variables, in numerical order, in FusionPro.

 

Any ideas or suggestions appreciated.

Link to comment
Share on other sites

I am looking to see if there is a way, perhaps with some variation on the FusionPro.Fields/AddVariable examples on the forum, to automatically insert a few hundred variables into four pages of price lists.

Sure, you can call FusionPro.Composition.AddVariable in a loop in OnRecordStart, something like this:

for (var fieldNum = 1; fieldNum <= 300; fieldNum++)
   FusionPro.Composition.AddVariable("Custom Var " + fieldNum, "Custom Value " + FormatNumber("000", fieldNum));

The catch is, the client says the field names do not stay the same. So right now they have a monthly process of having to manually insert the variables, in numerical order, in FusionPro.

That implies that there needs to be some kind of field mapping set up. This isn't impossible to do, but I can't offer any specific suggestions without more information about the field names in the data and the variable names used in the job. I'm also not quite sure what you mean by, "in numerical order." An example may be helpful.

Link to comment
Share on other sites

I'm also not quite sure what you mean by, "in numerical order." An example may be helpful.

Right, I should have added that the lists are in order by part number lowest to highest, however I am going to see if the client would be O.K. with doing that sort in the data. I'lll try this loop out. Thanks Dan.

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