Thread: On Record Start
View Single Post
  #1  
Old July 31st, 2017, 08:08 AM
gdellaiera gdellaiera is offline
Regular Contributor
 
Join Date: Nov 2016
Posts: 78
Default On Record Start

So I was able to come up with a good rule for On Record Start for a Name/Title field, but then had to add in a condition for the address as well. It worked perfectly fine until I added the address portion & now it will only use the 'long page', even when the 'short page' is supposed to be used.

Is there something missing below? I've been racking my brain to figure out what is going on, but every time I validate, FusionPro returns 'Expressions Ok'.

Thanks for the look.

var name = Field("Name");

var title = Field("Title");

var nametitle = name + "," + title;

if (nametitle.length <= 26){
FusionPro.Composition.SetBodyPageUsage("Short Name", true);
FusionPro.Composition.SetBodyPageUsage("Long Name", false);
}
else{
FusionPro.Composition.SetBodyPageUsage("Short Name", false);
FusionPro.Composition.SetBodyPageUsage("Long Name", true);
};

var address = Rule("Format Address");

if (address.length <= 40){
FusionPro.Composition.SetBodyPageUsage("Short Name", true);
FusionPro.Composition.SetBodyPageUsage("Long Name", false);
}
else{
FusionPro.Composition.SetBodyPageUsage("Short Name", false);
FusionPro.Composition.SetBodyPageUsage("Long Name", true);
}
Reply With Quote