I have a business card that the client would like to have multiple locations on the backside of the card. Due to my poor ability to understand or write javascript I decided to make a template for each option. Meaning if they have a value in "Location 1" it pulls the "Location 1" backside. Now when I tried to ask it to see if there is a value in "location 2" use "location2" I'm not getting the results I was expecting.
There will be a total of 8 different locations on the back of the card. Before I write all of this, can you tell me why this code isn't working? Currently when I do the compose, all of the records generate "Location1" even though record #2 has 2 locations:
if (Field("Phone") == "" && Field("Location1")!= "") {
FusionPro.Composition.SetBodyPageUsage("FrontNoOffice",true);
FusionPro.Composition.SetBodyPageUsage("Location1",true);
} else if (Field("Cell") == "" && Field("Location1")!= "") {
FusionPro.Composition.SetBodyPageUsage("FrontNoCell",true);
FusionPro.Composition.SetBodyPageUsage("Location1",true);
} else if (Field("Phone")!= "" && Field("Cell")!= "" && Field("Location1")!= "") {
FusionPro.Composition.SetBodyPageUsage("FrontAll",true);
FusionPro.Composition.SetBodyPageUsage("Location1",true);
} else if (Field("Phone") == "" && Field("Location2")!= "") {
FusionPro.Composition.SetBodyPageUsage("FrontNoOffice",true);
FusionPro.Composition.SetBodyPageUsage("Location2",true);
} else if (Field("Cell") == "" && Field("Location2")!= "") {
FusionPro.Composition.SetBodyPageUsage("FrontNoCell",true);
FusionPro.Composition.SetBodyPageUsage("Location2",true);
} else if (Field("Phone")!= "" && Field("Cell")!= "" && Field("Location2")!= "") {
FusionPro.Composition.SetBodyPageUsage("FrontAll",true);
FusionPro.Composition.SetBodyPageUsage("Location2",true);
}