rgreenidge Posted May 25, 2009 Share Posted May 25, 2009 I have a template that requires more the one "OnRecordStart" Rule, but I am unable to get both of them to function in the same template. Is this possible. I am using FP 6.0 on a Mac. Thanks, Richard. Link to comment Share on other sites More sharing options...
esmith Posted May 26, 2009 Share Posted May 26, 2009 FusionPro only processes one record at a time so as for the rule, like Highlander, there can be only one. What are you trying to do? I would think you would place both "functions" in the one rule. Link to comment Share on other sites More sharing options...
rgreenidge Posted May 26, 2009 Author Share Posted May 26, 2009 For the first function I want to turn off and on Unused Body pages and the second part I want to use the Repeat record count function. Thanks, Richard. Link to comment Share on other sites More sharing options...
esmith Posted May 26, 2009 Share Posted May 26, 2009 You would perform both "actions" in the one rule. I do it all the time. Link to comment Share on other sites More sharing options...
rgreenidge Posted May 26, 2009 Author Share Posted May 26, 2009 Thanks Eric for the reply, is there a certain command that I have to insert between the two scripts to combine them. Thanks, Richard. Link to comment Share on other sites More sharing options...
Dan Korn Posted May 26, 2009 Share Posted May 26, 2009 You should just be able to copy and paste both sections of the code into the single rule. What happens when you try this? If you could paste the code here, it would be a lot easier to help. Link to comment Share on other sites More sharing options...
rgreenidge Posted May 26, 2009 Author Share Posted May 26, 2009 Hi Dan, here are the scripts I am trying to use: if (Field("PR_LETTER") == "RTF") { FusionPro.Composition.SetBodyPageUsage("RT_F", true); } else if (Field("PR_LETTER") == "RTE") { FusionPro.Composition.SetBodyPageUsage("RT_E", true); } else if (Field("PR_LETTER") == "ICE") { FusionPro.Composition.SetBodyPageUsage("IC_E", true); } else if (Field("PR_LETTER") == "ICF") { FusionPro.Composition.SetBodyPageUsage("IC_F", true); } else if (Field("PR_LETTER") == "IVF") { FusionPro.Composition.SetBodyPageUsage("IV_F", true); } else if (Field("PR_LETTER") == "MTF") { FusionPro.Composition.SetBodyPageUsage("MT_F", true); } else if (Field("PR_LETTER") == "MTE") { FusionPro.Composition.SetBodyPageUsage("MT_E", true); } Link to comment Share on other sites More sharing options...
esmith Posted May 26, 2009 Share Posted May 26, 2009 Nope. In my data, I have a field for the version and a field for the quantity of that record needed. Assuming I name my PDF pages the same as the information in the associated field, my OnRecordStart rule looks something like this: //assign which page to use per record FusionPro.Composition.SetBodyPageUsage(Field("PR_LETTER"),true); //assign how many copies of each record to output FusionPro.Composition.RepeatRecordCount(Field("Quantity")); If I have a front and back for each version, I create variables that are built from the field name and then place them in the SetBodyPageUsage argument like so: //make sure these results match page names assigned in "Manage Pages..." var Front = Field("PR_LETTER") + "-front"; var Back = Field("PR_LETTER") + "-back"; //assign which pages to use per record FusionPro.Composition.SetBodyPageUsage(Front,true); FusionPro.Composition.SetBodyPageUsage(Back,true); //assign how many copies of each record to output FusionPro.Composition.RepeatRecordCount(Field("Quantity")); In your case, you would need to remove the underscore from the page name so that the page name matches the name in the field of the associated record. HTH. Link to comment Share on other sites More sharing options...
Dan Korn Posted May 26, 2009 Share Posted May 26, 2009 Hi Dan, here are the scripts I am trying to use: if (Field("PR_LETTER") == "RTF") { FusionPro.Composition.SetBodyPageUsage("RT_F", true); } <snip> Okay, so that's one. What's the other? What happens if you just put that other logic after this? Link to comment Share on other sites More sharing options...
rgreenidge Posted May 28, 2009 Author Share Posted May 28, 2009 Hi Gentlemen, I am now getting a chance to try what Eric has suggested. When I got to validate it gives me an error that Fusion Pro has no properties. Thanks, Richard. Link to comment Share on other sites More sharing options...
Dan Korn Posted May 28, 2009 Share Posted May 28, 2009 Hi Gentlemen, I am now getting a chance to try what Eric has suggested. When I got to validate it gives me an error that Fusion Pro has no properties. Can you please copy-and-paste the exact contents of the rule, and of the error message? There's a typo in Eric's post ("FusionPro.Compostion.RepeatRecordCount" should be ("FusionPro.Composition.RepeatRecordCount"), so I suspect that might be the cause of the error. Link to comment Share on other sites More sharing options...
rgreenidge Posted May 29, 2009 Author Share Posted May 29, 2009 Hi Dan, here is what I have: //assign which page to use per record FusionPro.Composition.SetBodyPageUsage(Field("PR_LETTER"),true); //assign how many copies of each record to output FusionPro.Compostion.RepeatRecordCount(Field("PR_QTY")); Link to comment Share on other sites More sharing options...
esmith Posted May 29, 2009 Share Posted May 29, 2009 Hi Dan, here is what I have: //assign which page to use per record FusionPro.Composition.SetBodyPageUsage(Field("PR_LETTER"),true); //assign how many copies of each record to output FusionPro.Compostion.RepeatRecordCount(Field("PR_QTY")); Dan is correct -- I didn't win the spelling bee. Change "Compostion" to "Composition" in the quantity code. Link to comment Share on other sites More sharing options...
rgreenidge Posted May 29, 2009 Author Share Posted May 29, 2009 Gentleman, this is working now. Thanks for all the help. Richard. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.