View Single Post
Old May 23rd, 2018, 06:03 PM
step's Avatar
step step is offline
Senior Contributor
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Switching pages with on record start

Originally Posted by gdellaiera View Post
I don't just have 3 pages of the specific sizes (18x12, 60x30 & 72x36), but 9 pages, one for each size and style due to text frames being completely different throughout.
Yes, I know. But you only have 3 size options. The switch statement determines which size to use. From there, the style is appended to the size to create the page name.

Originally Posted by gdellaiera View Post
The years will only be entered in values between 1-5, 10-15, 20-25 or 30 +, none of the in-between values.
Are you saying that the value of the "Years of Service" field is a string value representing a range of numbers (like "1-5") or just that the user will never enter a number outside of those specified ranges (like 6)? The latter of which shouldn't make a difference and the code should still work. But, if the values are string ranges, you could modify the code like this:
var background = Field("Background") || 'Style 1';
switch (Field("Years of Service")) {
  case '1-5':
  case '10-15':
    size = '18x12';
  case '20-25':
    size = '60x30';
  default: size = '72x36';
FusionPro.Composition.SetBodyPageUsage(background + " " + size, true);
Originally Posted by gdellaiera View Post
Each year range determines a size for the banner and adding the style from a drop down list would determine which page of the template to be used.

Does this make more sense?
Right, and again, that's what the code I posted is doing. It determines the size needed based on the "Years of Service" and adds the style selected from the drop down list to it.
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

Reply With Quote