WBG-guy Posted February 27, 2013 Share Posted February 27, 2013 (edited) I have a business card that has different options for fronts and backs depending on what they choose. Our client wanted to add another back option but I'm unable to make it work. Here are the possible fronts and backs In the "card" Field they choose... 1. snowbasin (front=snowbasin, back=sunvalley) 2. sunvalley (f=sunvalley, b=back) 3. SV. Condominium Op. (f=sunvalley, b=back) 4. Retail (f=Retail, b=retailback) NEW BACKER OPTION 5. Recreation (f=sunvalley, b=recback) Here's the old script I had that worked... if (Field("card") == "snowbasin") { FusionPro.Composition.SetBodyPageUsage("snowbasin",true) ; } else if (Field("card") == "sunvalley") { FusionPro.Composition.SetBodyPageUsage("sunvalley",true) ; } else if (Field("card") == "SV. Condomminium Op.") { FusionPro.Composition.SetBodyPageUsage("sunvalley",true) ; } else if (Field("card") == "Retail") { FusionPro.Composition.SetBodyPageUsage("Retail",true) ; } else if (Field("card") == "Recreation") { FusionPro.Composition.SetBodyPageUsage("sunvalley",true) ; FusionPro.Composition.SetBodyPageUsage("recback",true) ; FusionPro.Composition.SetBodyPageUsage("back",false) ; } Its been a while since I edited this script so anything you can do to help fix would be greatly appreciated. Thanks Edited February 27, 2013 by WBG-guy Missed some information Quote Link to comment Share on other sites More sharing options...
Alex Marshall Posted February 27, 2013 Share Posted February 27, 2013 Did you name the pages in the template? Go to FusionPro > Manage Pages... and edit each page so that each has a name. In the Manage Pages... dialog, go ahead and set the first page to "used" and the remaining pages as "Unused". Quote Link to comment Share on other sites More sharing options...
WBG-guy Posted February 27, 2013 Author Share Posted February 27, 2013 I tried that, before I posted my issue. The Retail back is called "retailback" in fusionpro. Any other suggestions? Quote Link to comment Share on other sites More sharing options...
step Posted February 28, 2013 Share Posted February 28, 2013 Try using a switch statement to accomplish this and clean up the code a little bit: switch (Field("card")) { case "snowbasin": FusionPro.Composition.SetBodyPageUsage("snowbasin",true); FusionPro.Composition.SetBodyPageUsage("sunvalley",true); break; case "sunvalley": case "SV. Condominium Op.": FusionPro.Composition.SetBodyPageUsage("sunvalley",true); FusionPro.Composition.SetBodyPageUsage("back",true); break; case "Retail": FusionPro.Composition.SetBodyPageUsage("Retail",true); FusionPro.Composition.SetBodyPageUsage("retailback",true); break; case "Recreation": FusionPro.Composition.SetBodyPageUsage("sunvalley",true); FusionPro.Composition.SetBodyPageUsage("recback",true); break; } Quote Link to comment Share on other sites More sharing options...
WBG-guy Posted February 28, 2013 Author Share Posted February 28, 2013 Once again, I apologize for my inexperience with this so please bare with me... Do I replace the current "OnRecordStart" rule with this "switch rule" that you provided? In the "OnRecordStart" rule?? Quote Link to comment Share on other sites More sharing options...
step Posted February 28, 2013 Share Posted February 28, 2013 (edited) Yes. Are you asking because you did that and it didn't work? After re-reading the entire thread, I'm not sure why Alex suggested setting the first page to "used". They should all be set to "unused" and turned on via the OnRecordStart rule so that you only end up with 2 pages (front and back) per record. Edited February 28, 2013 by step Quote Link to comment Share on other sites More sharing options...
WBG-guy Posted February 28, 2013 Author Share Posted February 28, 2013 That worked perfectly! I did what you suggested in making all the pages unused. Thanks again for all your help! 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.