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 May 25th, 2009, 02:53 PM
rgreenidge rgreenidge is offline
Regular Contributor
 
Join Date: Sep 2008
Location: Toronto, Canada
Posts: 57
Default Using More than one OnRecord Start

I have a template that requires more the one "OnRecordStart" Rule, but I am unable to get both of them to function in the same template. Is this possible.

I am using FP 6.0 on a Mac.

Thanks,
Richard.
Reply With Quote
  #2  
Old May 26th, 2009, 05:37 AM
esmith esmith is offline
Senior Contributor
 
Join Date: Oct 2008
Location: Charlotte, NC
Posts: 869
Default Re: Using More than one OnRecord Start

FusionPro only processes one record at a time so as for the rule, like Highlander, there can be only one. What are you trying to do? I would think you would place both "functions" in the one rule.
Reply With Quote
  #3  
Old May 26th, 2009, 07:08 AM
rgreenidge rgreenidge is offline
Regular Contributor
 
Join Date: Sep 2008
Location: Toronto, Canada
Posts: 57
Default Re: Using More than one OnRecord Start

For the first function I want to turn off and on Unused Body pages and the second part I want to use the Repeat record count function.

Thanks,
Richard.
Reply With Quote
  #4  
Old May 26th, 2009, 08:02 AM
esmith esmith is offline
Senior Contributor
 
Join Date: Oct 2008
Location: Charlotte, NC
Posts: 869
Default Re: Using More than one OnRecord Start

You would perform both "actions" in the one rule. I do it all the time.
Reply With Quote
  #5  
Old May 26th, 2009, 09:02 AM
rgreenidge rgreenidge is offline
Regular Contributor
 
Join Date: Sep 2008
Location: Toronto, Canada
Posts: 57
Default Re: Using More than one OnRecord Start

Thanks Eric for the reply, is there a certain command that I have to insert between the two scripts to combine them.

Thanks,
Richard.
Reply With Quote
  #6  
Old May 26th, 2009, 10:46 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,671
Default Re: Using More than one OnRecord Start

You should just be able to copy and paste both sections of the code into the single rule. What happens when you try this? If you could paste the code here, it would be a lot easier to help.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #7  
Old May 26th, 2009, 10:57 AM
rgreenidge rgreenidge is offline
Regular Contributor
 
Join Date: Sep 2008
Location: Toronto, Canada
Posts: 57
Default Re: Using More than one OnRecord Start

Hi Dan, here are the scripts I am trying to use:

if (Field("PR_LETTER") == "RTF")
{
FusionPro.Composition.SetBodyPageUsage("RT_F", true);
}
else if (Field("PR_LETTER") == "RTE")
{
FusionPro.Composition.SetBodyPageUsage("RT_E", true);
}
else if (Field("PR_LETTER") == "ICE")
{
FusionPro.Composition.SetBodyPageUsage("IC_E", true);
}
else if (Field("PR_LETTER") == "ICF")
{
FusionPro.Composition.SetBodyPageUsage("IC_F", true);
}
else if (Field("PR_LETTER") == "IVF")
{
FusionPro.Composition.SetBodyPageUsage("IV_F", true);
}
else if (Field("PR_LETTER") == "MTF")
{
FusionPro.Composition.SetBodyPageUsage("MT_F", true);
}
else if (Field("PR_LETTER") == "MTE")
{
FusionPro.Composition.SetBodyPageUsage("MT_E", true);
}
Reply With Quote
  #8  
Old May 26th, 2009, 11:51 AM
esmith esmith is offline
Senior Contributor
 
Join Date: Oct 2008
Location: Charlotte, NC
Posts: 869
Default Re: Using More than one OnRecord Start

Nope. In my data, I have a field for the version and a field for the quantity of that record needed. Assuming I name my PDF pages the same as the information in the associated field, my OnRecordStart rule looks something like this:
Code:
//assign which page to use per record
FusionPro.Composition.SetBodyPageUsage(Field("PR_LETTER"),true);

//assign how many copies of each record to output
FusionPro.Composition.RepeatRecordCount(Field("Quantity"));
If I have a front and back for each version, I create variables that are built from the field name and then place them in the SetBodyPageUsage argument like so:
Code:
//make sure these results match page names assigned in "Manage Pages..."
var Front = Field("PR_LETTER") + "-front";
var Back = Field("PR_LETTER") + "-back"; 

//assign which pages to use per record
FusionPro.Composition.SetBodyPageUsage(Front,true);
FusionPro.Composition.SetBodyPageUsage(Back,true);

//assign how many copies of each record to output
FusionPro.Composition.RepeatRecordCount(Field("Quantity"));
In your case, you would need to remove the underscore from the page name so that the page name matches the name in the field of the associated record. HTH.

Last edited by esmith; May 29th, 2009 at 07:09 AM.. Reason: spelling error in code
Reply With Quote
  #9  
Old May 26th, 2009, 12:45 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,671
Default Re: Using More than one OnRecord Start

Quote:
Originally Posted by rgreenidge View Post
Hi Dan, here are the scripts I am trying to use:

if (Field("PR_LETTER") == "RTF")
{
FusionPro.Composition.SetBodyPageUsage("RT_F", true);
}
<snip>
Okay, so that's one. What's the other? What happens if you just put that other logic after this?
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #10  
Old May 28th, 2009, 09:45 AM
rgreenidge rgreenidge is offline
Regular Contributor
 
Join Date: Sep 2008
Location: Toronto, Canada
Posts: 57
Default Re: Using More than one OnRecord Start

Hi Gentlemen, I am now getting a chance to try what Eric has suggested. When I got to validate it gives me an error that Fusion Pro has no properties.

Thanks,
Richard.
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 10:34 PM.


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