bkurzbuch Posted October 28, 2019 Share Posted October 28, 2019 I'm having trouble with the syntax for a page usage rule and where to apply it. I have a 3 page document with 2 different backs. If field-2 is not blank use page back_2, if field-2 is blank use page back_1. Since you can have only 1 On Record start rule i believe. I already have a rule to suppress the first page on press output in Marcom. Listed below. Do i just add my page usage rule to it? Thanks For the help. FusionPro.Composition.SetBodyPageUsage("front", IsPreview()); Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted October 28, 2019 Share Posted October 28, 2019 Since you can have only 1 On Record start rule [...] Do i just add my page usage rule to it? Yes, you add it to the existing OnRecordStart rule. Quote Link to comment Share on other sites More sharing options...
bkurzbuch Posted October 28, 2019 Author Share Posted October 28, 2019 Thank You I've added my code to the excessing rule but am getting a syntax error on line 4 and I don't understand why. Thanks for your help. FusionPro.Composition.SetBodyPageUsage("front", IsPreview()); if (Field("Imprint Line 2")) == "" { SetBodyPageUsage("back_1",true); SetBodyPageUsage("back_2",false); } else { SetBodyPageUsage("back_1",false); SetBodyPageUsage("back_2",true); } Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted October 28, 2019 Share Posted October 28, 2019 Thank You I've added my code to the excessing rule but am getting a syntax error on line 4 and I don't understand why. Thanks for your help. if (Field("Imprint Line 2")) == "" That line should be: if (Field("Imprint Line 2") == "") Or just: if (!Field("Imprint Line 2")) Or, rearranging a bit: if (Field("Imprint Line 2")) { FusionPro.Composition.SetBodyPageUsage("back_1", false); FusionPro.Composition.SetBodyPageUsage("back_2", true); } else { FusionPro.Composition.SetBodyPageUsage("back_1", true); FusionPro.Composition.SetBodyPageUsage("back_2", false); } Or: var imprint2 = Field("Imprint Line 2"); FusionPro.Composition.SetBodyPageUsage("back_1", !imprint2); FusionPro.Composition.SetBodyPageUsage("back_2", imprint2); Note that you have to call FusionPro.Composition.SetBodyPageUsage, not just SetBodyPageUsage. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.