Jump to content

Multiple pg body usage


dmp

Recommended Posts

Hi there,

I'm getting weird results and I'm not sure where my code is wrong.

I have 4 pages all set to unused.

Local records are page 1 & 2

Out of state are 3 & 4

so I'm using this OnRecordStart rule

but I'll get something like record 1 = pg 1,3,4.

 

if (Field("List")=="Local")
{
FusionPro.Composition.SetBodyPageUsage("1", true)
FusionPro.Composition.SetBodyPageUsage("2", true)
FusionPro.Composition.SetBodyPageUsage("3", false)
FusionPro.Composition.SetBodyPageUsage("4", false)
} 
if (Field("List")=="Out of State")
FusionPro.Composition.SetBodyPageUsage("1", false)
FusionPro.Composition.SetBodyPageUsage("2", false)
FusionPro.Composition.SetBodyPageUsage("3", true)
FusionPro.Composition.SetBodyPageUsage("4", true)
}

I tried to look at the code Dan wrote for page ranges, but I can't wrap my head around the var i <= 6 i++ stuff. o.O

Anyone know what I'm doing wrong here?

 

Cheers,

Mike

Link to comment
Share on other sites

Are your pages named 1, 2, 3, and 4? If not you may need to make the page numbers integers instead of strings:

if (Field("List")=="Local")
{
FusionPro.Composition.SetBodyPageUsage(1, true)
FusionPro.Composition.SetBodyPageUsage(2, true)
FusionPro.Composition.SetBodyPageUsage(3, false)
FusionPro.Composition.SetBodyPageUsage(4, false)
} 
if (Field("List")=="Out of State")
FusionPro.Composition.SetBodyPageUsage(1, false)
FusionPro.Composition.SetBodyPageUsage(2, false)
FusionPro.Composition.SetBodyPageUsage(3, true)
FusionPro.Composition.SetBodyPageUsage(4, true)
}

Or:

var page = Field("List") == "Local" ? 1 : 3;
FusionPro.Composition.SetBodyPageUsage(page, true);
FusionPro.Composition.SetBodyPageUsage(page + 1, true);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...