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

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old February 25th, 2010, 03:06 PM
DSweet's Avatar
DSweet DSweet is offline
Senior Contributor
 
Join Date: Sep 2008
Location: Oberlin, Ohio
Posts: 253
Default Re: OnJobStart data input

Yes that would work, however I think that George was trying to not have to change the template time and time again for something as small a change as only a new "letter mailing date". It would be simpler to have an external spot to change something as simple as a run-date on a letter. This was you can run the job off of FusionPro Server and never need to change the template - unless the body of the letter actually changed.
.
__________________
David A. Sweet
Variable Data Specialist
HKM Direct Market Communications
Windows 7, Acrobat 10.x
FusionPro Desktop and Server 10.0.26
Reply With Quote
  #12  
Old February 26th, 2010, 09:17 AM
george.goodeluinas's Avatar
george.goodeluinas george.goodeluinas is offline
Junior Community Member
 
Join Date: Jan 2010
Location: Central PA
Posts: 11
Default Re: OnJobStart data input

Lester,
The date is the same through out the job, but it changes each time I need to run the job. So I would need to change it either in the rule or in the text file before each time I run the job. 6 Of one, half a dozen of the other.
Thanks for the input.
Geortge
__________________
Fusion Pro Desktop 6.2P1a
Windows 7 64 bit Home Premium
Acrobat 8 Pro Ver 8.2.0
Reply With Quote
  #13  
Old May 22nd, 2015, 07:38 AM
ThePorge ThePorge is offline
Regular Contributor
 
Join Date: Aug 2011
Location: Georgia
Posts: 83
Default Re: OnJobStart data input

Quote:
Originally Posted by Doug Pershing View Post
Hi George,

Since the date is not "predictable" it is difficult to create some kind of automated function. We had to deal with this same issue and through talking with the customer we were able to determine exactly why the dates were the they they were. In turn we found a way to calculate them.

If there is actually no way to calculate them then somebody needs to enter them somewhere. There are a couple of options:

1. Simply open the rule editor and enter the date you want to use like this:
At the top of the JavaScript Globals
Code:
date = "03/15/2010"
Since this is plain text you could literally enter the date exactly as you want it to appear. Now in any rule simply add this to your result.

Code:
return "Static text before the date " + date + " with the rest of the text after the date."
2. Shift the burden to the customer for the date entry by formating a small Excel file containing the date. Name the Excel file DateMatrix. Give the customer the Excel file to edit. When they send you the new file save it as a csv file. For simplicities sake save this small csv file in the root directory with you FP file.

StartDate EndDate
January 01, 2010 February 01, 2010

Enter this in the JavaScript Globals:

Code:
 
//Set the Date Matrix to retrieve the customer values
//Since it is in the root directory no path is needed to locate the file.
DateMatrix = new ExternalDataFileEx("DateMatrix.csv", ",")
Enter this in the OnJobStart callback rule. This will load the value and set the variables once as the job begins.

Code:
 
//Set the date variables 
StartDate = DateMatrix.GetFieldValue(1,"StartDate");
EndDate = DateMatrix.GetFieldValue(1,"EndDate");
Then create a rule called Offer Dates and enter this:

Code:
 
//Use the date variables entered in OnJobStart
return "Start Date: " + StartDate + " -- End Date: " + EndDate
Then place the rule into a text box on your layout. Whatever is entered in the fields in the Date Matrix csv file will be placed in the layout. I have attached a small example file. I hope this helps.
Attachment 210
I pulled your test file and when validating the rule it returns the date correctly...However when you output this after linking to a data file this doesn't work. I discovered this when trying to implement something similar to this and couldn't get it to work.
Don't the two variables you created ("StartDate" and "EndDate") need to be Global in scope rather than rule specific...or are variables under a "OnJobStart" rule global? I moved my variable to a Global scope, but even when moving my variables to a Global scope I can't get this to function correctly. My rule will also return the correct result when validating the rule, but fails when composing. I'm not sure why that is....?
Reply With Quote
  #14  
Old May 22nd, 2015, 09:20 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,655
Default Re: OnJobStart data input

Quote:
Originally Posted by ThePorge View Post
I pulled your test file and when validating the rule it returns the date correctly...However when you output this after linking to a data file this doesn't work. I discovered this when trying to implement something similar to this and couldn't get it to work.
Please be more specific about what doesn't work.
Quote:
Originally Posted by ThePorge View Post
Don't the two variables you created ("StartDate" and "EndDate") need to be Global in scope rather than rule specific...or are variables under a "OnJobStart" rule global?
All variables in JavaScript are global, unless declared with the "var" keyword. (All variables declared in the JavaScript Globals are also global, even if the "var" keyword is used.)
__________________
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
  #15  
Old May 22nd, 2015, 09:47 AM
ThePorge ThePorge is offline
Regular Contributor
 
Join Date: Aug 2011
Location: Georgia
Posts: 83
Default Re: OnJobStart data input

In the test file that I pulled from this site the pdf file has a rule called "Offer Dates". If you validate this rule it will return the correct values from the csv file "DateMatrix.csv". I took this FusionPro pdf and Imported a data file. Created a text field and assigned some variable values. I left the field alone that was already created in the file and did not move the DateMatrix.csv file that it is calling for the data. Then I output the file. The dates then didn't work and I got "Start Date: -- End Date:" where I should have gotten "Start Date: January 01, 2010 -- End Date: February 15, 2010" in all the records output.
Reply With Quote
  #16  
Old May 22nd, 2015, 10:07 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,655
Default Re: OnJobStart data input

Quote:
Originally Posted by ThePorge View Post
In the test file that I pulled from this site the pdf file has a rule called "Offer Dates". If you validate this rule it will return the correct values from the csv file "DateMatrix.csv". I took this FusionPro pdf and Imported a data file. Created a text field and assigned some variable values. I left the field alone that was already created in the file and did not move the DateMatrix.csv file that it is calling for the data. Then I output the file. The dates then didn't work and I got "Start Date: -- End Date:" where I should have gotten "Start Date: January 01, 2010 -- End Date: February 15, 2010" in all the records output.
What versions of FusionPro, Acrobat, and the operating system?
__________________
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
  #17  
Old May 22nd, 2015, 10:33 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,655
Default Re: OnJobStart data input

I see what the problem is. The call to the ExternalDataFileEx constructor function should be in OnJobStart, not in the JavaScript Globals.

The JavaScript Globals area isn't really a rule; it's intended only for declarations of variables and functions, not for "doing" things, because all of the things that are normally present when rules are run are not yet set up, including the search path, which is needed to resolve the relative path "DateMatrix.csv" to a fully-qualified path. (The functions declared in the JavaScript Globals can "do" things, as long as those functions are only called from actual rules.)

So just move this line into the OnJobStart rule:
Code:
DateMatrix = new ExternalDataFileEx("DateMatrix.csv", ",");
And everything will work.
__________________
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
  #18  
Old May 22nd, 2015, 11:31 AM
ThePorge ThePorge is offline
Regular Contributor
 
Join Date: Aug 2011
Location: Georgia
Posts: 83
Default Re: OnJobStart data input

OSX 10.10.3
Acrobat Build: 11.0.11.18
FusionPro 9.3.6
Reply With Quote
  #19  
Old May 22nd, 2015, 03:10 PM
ThePorge ThePorge is offline
Regular Contributor
 
Join Date: Aug 2011
Location: Georgia
Posts: 83
Default Re: OnJobStart data input

Bam!! Tks all, very good info in this thread.
Reply With Quote
Reply

Tags
onrecordstart, prompt

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 05:52 PM.


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