rpaterick Posted August 23, 2011 Share Posted August 23, 2011 2 page document. I need the code to state: When rbhealth.com is in the data field "purchase site," return pages 1 and 3 only. All other records, return pages 1 and 2 only. Current Code. Just can't figure out how to state when the field isn't rbhealth.com to return others. if (Field(" PurchaseSite") == "????????????") { FusionPro.Composition.SetBodyPageUsage("1",true); FusionPro.Composition.SetBodyPageUsage("2",true) ; } if (Field(" PurchaseSite") == "rbhealth.com") { FusionPro.Composition.SetBodyPageUsage("1",true) ; FusionPro.Composition.SetBodyPageUsage("3",true) ; } else return ""; Link to comment Share on other sites More sharing options...
Dan Korn Posted August 23, 2011 Share Posted August 23, 2011 Just put the logic for the opposite of the "if" condition in the "else" block: if (Field("PurchaseSite") == "rbhealth.com") { FusionPro.Composition.SetBodyPageUsage("1",true); FusionPro.Composition.SetBodyPageUsage("3",true); } else { FusionPro.Composition.SetBodyPageUsage("1",true); FusionPro.Composition.SetBodyPageUsage("2",true); } Of course, since page 1 is always used, you can just set it that way in the Page Usage dialog, and then the rule reduces to this: if (Field("PurchaseSite") == "rbhealth.com") FusionPro.Composition.SetBodyPageUsage("3",true); else FusionPro.Composition.SetBodyPageUsage("2",true); Or even: FusionPro.Composition.SetBodyPageUsage("3", Field("PurchaseSite") == "rbhealth.com"); FusionPro.Composition.SetBodyPageUsage("2", Field("PurchaseSite") != "rbhealth.com"); Or, even simpler: FusionPro.Composition.SetBodyPageUsage((Field("PurchaseSite") == "rbhealth.com") ? "3" : "2", true); Link to comment Share on other sites More sharing options...
rpaterick Posted August 23, 2011 Author Share Posted August 23, 2011 Thanks again Dan. Like the H2 bike you have BTW.. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.