I have an OnRecordStart rule that is not acting the way I think it should. I have a work-around by using IF statements versus the SWITCH rule I tried to use. However, I thought I'd ask here to see why this doesn't work the way I think it should:
FusionPro.Composition.SetBodyPageUsage("INVY_SHOPPERS_SRP", false);
FusionPro.Composition.SetBodyPageUsage("INVENTORY SRP", false);
FusionPro.Composition.SetBodyPageUsage("INVENTORY ONLY", false);
FusionPro.Composition.SetBodyPageUsage("SHOPPERS SRP", false);
FusionPro.Composition.SetBodyPageUsage("SHOPPERS ONLY", false);
switch (Field("VERSION"))
{
case "Invy, Shoppers, SRP": FusionPro.Composition.SetBodyPageUsage("INVY_SHOPPERS_SRP", true);
case "Inventory, SRP": FusionPro.Composition.SetBodyPageUsage("INVENTORY SRP", true);
case "Inventory": FusionPro.Composition.SetBodyPageUsage("INVENTORY ONLY", true);
case "Shoppers, SRP": FusionPro.Composition.SetBodyPageUsage("SHOPPERS SRP", true);
case "Shoppers": FusionPro.Composition.SetBodyPageUsage("SHOPPERS ONLY", true);
}
What is actually happening is that the case statement that matches is working and turning on the page that is should, but every case statement listed after that one is also turning on its respective page.
Anyone have any idea why?