Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 7th, 2009, 08:14 AM
kopytekinc kopytekinc is offline
Junior Community Member
 
Join Date: Dec 2009
Posts: 21
Default Page selection

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("coBorrowFr ont",true);
FusionPro.Composition.SetBodyPageUsage("coBorrowBa ck",true);
}
else if (Field("ID_ALR") == "3")
{
FusionPro.Composition.SetBodyPageUsage("borrowFron t",true);
FusionPro.Composition.SetBodyPageUsage("borrowBack ",true);
}
else
ReportError("Can't set pages for BirthdayCard: " + Field("ID_ALR"));

Thanks for your help in advance
Reply With Quote
  #2  
Old December 7th, 2009, 09:01 AM
esmith's Avatar
esmith esmith is offline
Senior Contributor
 
Join Date: Oct 2008
Location: Charlotte, NC
Posts: 870
Default Re: Page selection

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:
Code:
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.
__________________
Eric Smith
Content Developer
Classic
FP 9.3.6, MAC OSX 10.9.4, Acrobat 11.0.09
Reply With Quote
  #3  
Old December 7th, 2009, 10:00 AM
kopytekinc kopytekinc is offline
Junior Community Member
 
Join Date: Dec 2009
Posts: 21
Default Re: Page selection

mr esmith, I had actually found your post in the forums for another post and used it verbatim even changing my variables to match yours, only to realize there was a naming issue, all is good. Thanks for your help =]
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:27 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.