Jump to content

Page selection


kopytekinc

Recommended Posts

I have reviewed several of the samples provided as well as dug through the javascript manual for FP but am still struggling getting the page selection dependent on a variable set.

 

Below is my script My pages are set to (coBorrowFront, coBorrowBack, borrowFront, and borrowBack) each front back used in conjunction with each other. (All pages are currently set to unused) The field I am using to determine which pages is called ID_ALR, where 3 = the borrow pages and 4 = the coborrow pages. When I compose right now I am just testing using a single case for 4 and getting only 2 backs one coBorrowBack and one borrowBack.

 

if (Field("ID_ALR") == "4")

{

FusionPro.Composition.SetBodyPageUsage("coBorrowFront",true);

FusionPro.Composition.SetBodyPageUsage("coBorrowBack",true);

}

else if (Field("ID_ALR") == "3")

{

FusionPro.Composition.SetBodyPageUsage("borrowFront",true);

FusionPro.Composition.SetBodyPageUsage("borrowBack",true);

}

else

ReportError("Can't set pages for BirthdayCard: " + Field("ID_ALR"));

 

Thanks for your help in advance

Link to comment
Share on other sites

I like to set my page names equal to the data, so in your case, I would name my pages to 3-front, 3-back, 4-front and 4-back, and set all of them to be unused. Then in your OnRecordStart rule you could try the following:

FusionPro.Composition.SetBodyPageUsage(Field("ID_ALR") + "-front",true);
FusionPro.Composition.SetBodyPageUsage(Field("ID_ALR") + "-back",true);

Make sure you named your pages correctly in the ManagePages dialog -- your original results may just be that you have your pages ordered incorrectly. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...