Kal Posted May 5, 2016 Share Posted May 5, 2016 I’m using this rule “OnRecordStart” to call in different pages based on the data and I want to add an “Error” page to this rule and i’m having an issue trying to write it. The “Error” page will be called in when there is no match in the data for “E” or “F”. Help please. if (Field(“Data") != "E") { FusionPro.Composition.SetBodyPageUsage("E", false) } if (Field("Data") != "F") { FusionPro.Composition.SetBodyPageUsage("F", false) } Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted May 5, 2016 Share Posted May 5, 2016 Set all the pages (E, F, error, etc.) to be unused initially, and do this in the rule: try { FusionPro.Composition.SetBodyPageUsage(Field("Data"), true); } catch (e) { FusionPro.Composition.SetBodyPageUsage("Error", true); } Quote Link to comment Share on other sites More sharing options...
Kal Posted May 5, 2016 Author Share Posted May 5, 2016 Thank you Dan. That worked. Quote Link to comment Share on other sites More sharing options...
Kal Posted May 6, 2016 Author Share Posted May 6, 2016 Another issue Dan. This works fine for Simplex, one sided only. How would it work for Duplex, two sided per record? Record1 Page1 = E Page2 = E-2 Record2 Page1 = Error Page2 = Error-2 Page 2 will always be what the data calls in + -2 Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted May 6, 2016 Share Posted May 6, 2016 Another issue Dan. This works fine for Simplex, one sided only. How would it work for Duplex, two sided per record? Record1 Page1 = E Page2 = E-2 Record2 Page1 = Error Page2 = Error-2 Page 2 will always be what the data calls in + -2 Just do it again with the "-2": try { FusionPro.Composition.SetBodyPageUsage(Field("Data"), true); } catch (e) { FusionPro.Composition.SetBodyPageUsage("Error", true); } try { FusionPro.Composition.SetBodyPageUsage(Field("Data") + "-2", true); } catch (e) { FusionPro.Composition.SetBodyPageUsage("Error-2", true); } Quote Link to comment Share on other sites More sharing options...
Kal Posted May 6, 2016 Author Share Posted May 6, 2016 Thanks Dan, this truly save me hours from how I was originally doing it. 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.