Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > FusionPro® VDP Creator

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 7th, 2012, 03:41 PM
traba5058 traba5058 is offline
Regular Contributor
 
Join Date: Jan 2012
Location: Atlanta, GA
Posts: 77
Question Turn a Page On or Off based upon Field

Please Help! I'm creating a new business card template for a new customer that has a different back based upon the title.

So, I've setup a 3-page template and named the pages Front, BC and BCBI.

If the person's title in the title field is Account Supervisor, Senior Account Supervisor or Field Recruiter, it needs to return page BCBI. Otherwise, it returns page BC.

My Rule Validates
Code:
if (((Field("Title") == "Account Supervisor") || (Field("Title") == "Senior Account Supervisor")) || (Field("Title") == "Field Recruiter"))
{
FusionPro.Composition.SetBodyPageUsage("BCBI", true);
FusionPro.Composition.SetBodyPageUsage("BC", false);
}
 
else
{
FusionPro.Composition.SetBodyPageUsage("BCBI", false);
FusionPro.Composition.SetBodyPageUsage("BC", true);
}
But, I get the following error when I compose:
Compose Error:
OnJobStart, line 1: Error: In Field(), no data source defined or data could not be loaded
Job started 18:27:44 - 1352330864.
Creator: FusionPro(TM) Desktop 7.2P1k
Computer Name: STPRESSTRABA
Current working folder: D:\Customers\Hospitality Staffing Services\Products\Templates\BC\BCBI Composed
Template File: D:\Customers\Hospitality Staffing Services\Products\Templates\BC\BC_BCBI_BusinessCar d_Template.pdf
Input File: D:\Customers\Hospitality Staffing Services\Products\Templates\BC\bc_bi.txt
Composing record #1, input record 1
Composing record #2, input record 2
Composing record #3, input record 3
Composing record #4, input record 4
Composing record #5, input record 5
Composing record #6, input record 6
Composing record #7, input record 7
Composing record #8, input record 8
Job ended 18:27:50 - 1352330870.
Don't know if it's related:
I also have a graphic rule setup to place the correct background image on the page based upon the Title field. This rule is assigned to the background graphic on pages 2 & 3, which are the two backs of the card.

My Rule:
Code:
switch (Field("Title").toLowerCase())
{
 case "Account Supervisor".toLowerCase():
  return Resource("BCBI_BusinessCard_Back.pdf");
 case "Administrative Assistant".toLowerCase():
  return Resource("BC_BusinessCard_Back.pdf");
 case "Area Manager".toLowerCase():
  return Resource("BC_BusinessCard_Back.pdf");
 case "Business Development Coordinator".toLowerCase():
  return Resource("BC_BusinessCard_Back.pdf");
 case "Director of Operations".toLowerCase():
  return Resource("BC_BusinessCard_Back.pdf");
 case "Field Recruiter".toLowerCase():
  return Resource("BCBI_BusinessCard_Back.pdf");
 case "President/CEO".toLowerCase():
  return Resource("BC_BusinessCard_Back.pdf");
 case "Senior Account Executive".toLowerCase():
  return Resource("BC_BusinessCard_Back.pdf");
 case "Senior Account Supervisor".toLowerCase():
  return Resource("BCBI_BusinessCard_Back.pdf");
 case "Vice President".toLowerCase():
  return Resource("BC_BusinessCard_Back.pdf");
 case "Vice President of Operations".toLowerCase():
  return Resource("BC_BusinessCard_Back.pdf");
 case "eCommerce Systems Manager".toLowerCase():
  return Resource("BC_BusinessCard_Back.pdf");
 default:
  return "";
}
The composed file is creating 2 outputs for every record: one for each background image & back page (2 or 3).

This is the first time I am selecting pages in a template, so I pulled up my post card template that I created during PTI training to see how we did it there and tried to replicate it. I do not understand what I have done wrong.

Please help.
Reply With Quote
  #2  
Old November 7th, 2012, 03:53 PM
esmith's Avatar
esmith esmith is offline
Senior Contributor
 
Join Date: Oct 2008
Location: Charlotte, NC
Posts: 870
Default Re: Turn a Page On or Off based upon Field

On first glance, it looks like the two rules are solving the same problem. You are returning either back BC or back BCBI to a graphic frame on both page BC and page BCBI (via the graphic rule), but then (possibly) activating only the necessary back page based on the same data (via the callback rule).

Also, based on the error you posted, I'm guessing your "SetBodyPageUsage" rule is in an OnJobStart rule rather than the OnRecordStart rule.
__________________
Eric Smith
Content Developer
Classic
FP 9.3.6, MAC OSX 10.9.4, Acrobat 11.0.09
Reply With Quote
  #3  
Old November 7th, 2012, 04:13 PM
esmith's Avatar
esmith esmith is offline
Senior Contributor
 
Join Date: Oct 2008
Location: Charlotte, NC
Posts: 870
Default Re: Turn a Page On or Off based upon Field

I think your best bet would be to delete page 3 (BCBI) and leave both pages (front/BC) "Used" in page management. Then delete your callback rule (or at least the code entered above) regardless of whether it was in an OnJobStart rule or an OnRecordStart rule. Finally, pull in the correct back page graphic to page BC using the rule you created, but simplifying it to read:
Code:
switch (Field("Title").toLowerCase()) {
   case "account supervisor":
   case "field recruiter":
   case "senior account supervisor":
   return Resource("BCBI_BusinessCard_Back.pdf");

   case "administrative assistant":
   case "area manager":
   case "business development coordinator":
   case "director of operations":
   case "president/ceo":
   case "senior account executive":
   case "vice president":
   case "vice president of operations":
   case "ecommerce systems manager":
   default:
   return Resource("BC_BusinessCard_Back.pdf");
}
If I understand what you are trying to do, these changes should get you back on track. Good luck!
__________________
Eric Smith
Content Developer
Classic
FP 9.3.6, MAC OSX 10.9.4, Acrobat 11.0.09
Reply With Quote
  #4  
Old November 8th, 2012, 04:54 AM
traba5058 traba5058 is offline
Regular Contributor
 
Join Date: Jan 2012
Location: Atlanta, GA
Posts: 77
Smile Re: Turn a Page On or Off based upon Field

Thanks so much Eric. That was my error. I was using OnJobStart rather than OnRecordStart.
Reply With Quote
Reply

Tags
graphics, pages, select

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 06:18 PM.


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