Jump to content

"On Record Start" Rule Question


web2print

Recommended Posts

Hello,

 

I have a business card template that I am trying to set up but am having difficulty with the onrecordstart rule. I am a bit of a java and fusionpro noob and it is definitely user error but i was hoping you could help me out.

 

My template is for business cards. I have 2 front page options and 8 back page options. I previously had the back page options working great with a single front page. Now i have to add in the second front page and it is getting screwy.

 

Here is what my code looks like:

 

if(Field("CardType")=="Manager")

{

FusionPro.Composition.SetBodyPageUsage("Body 1",true);

}

else if(Field("CardType")=="Location")

{

FusionPro.Composition.SetBodyPageUsage("Body 2",true);

}

 

if(Field("BackVersion")=="40% off Services")

{

FusionPro.Composition.SetBodyPageUsage("40% off Services",true);

}

else if(Field("BackVersion")=="Massage Tech Specific (40% + Massage Starting Prices)")

{

FusionPro.Composition.SetBodyPageUsage("Massage Tech Specific (40% + Massage Starting Prices)",true);

}

else if(Field("BackVersion")=="Skin Tech Specific (40% + Skin Starting Prices)")

{

FusionPro.Composition.SetBodyPageUsage("Skin Tech Specific (40% + Skin Starting Prices)",true);

}

else if(Field("BackVersion")=="Nail Tech Specific (40% + Nail Starting Prices)")

{

FusionPro.Composition.SetBodyPageUsage("Nail Tech Specific (40% + Nail Starting Prices)",true);

}

else if(Field("BackVersion")=="Stylist Specific (40% + Hair Starting Prices)")

{

FusionPro.Composition.SetBodyPageUsage("Stylist Specific (40% + Hair Starting Prices)",true);

}

else if(Field("BackVersion")=="Popular Services Starting Prices + 40%")

{

FusionPro.Composition.SetBodyPageUsage("Popular Services Starting Prices + 40%",true);

}

else if(Field("BackVersion")=="Generic/No Offer")

{

FusionPro.Composition.SetBodyPageUsage("Generic/No Offer",true);

}

else if (Field("BackVersion")=="20% Referral")

{

FusionPro.Composition.SetBodyPageUsage("20% Referral",true);

}

return "";

 

Text highlighted in red is for the front page options and text in blue is for the back page options. Is there any way to separate these two pieces of code in the same rule? Like say "This part is for the front pages"(Red) and "This part is for the back pages"(Blue)

 

When i upload this to Marcom and do a preview, i just get both front pages and no back.

 

I am kind of lost with this one and would appreciate any advice you can give me!

 

Thank you!

Link to comment
Share on other sites

It seems to me that the entire blue (back) part can be reduced to this:

FusionPro.Composition.SetBodyPageUsage(Field("BackVersion"), true);

The red (front) logic can be reduced the same way, if you name your pages the same as the data field values ("Manager" and "Location").

FusionPro.Composition.SetBodyPageUsage(Field("CardType"), true);

So the entire rule could be just those two lines.

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...