Jump to content

Using More than one OnRecord Start


Recommended Posts

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

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

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

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

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

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

Archived

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

×
×
  • Create New...