Go Back   PTI Marketing Technologies User Community > Support > Issues, Questions, Etc.

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 22nd, 2012, 02:03 PM
Reino Reino is offline
Forum n00b
 
Join Date: Aug 2012
Posts: 2
Default Ability to compare record to next record in data source

I would like to be able to compare a field value in one record in my data source to see if it equals the value of that field in the next record in my data source. I would like to continue this comparison till the field value changes. The goal is to extract into each PDF letter all the rows that have the same field value in column one. So...instead of variable information coming from one record, I want to combine variable information from multiple rows (records) where a specific field value is the same. Has anyone done this?
Reply With Quote
  #2  
Old August 22nd, 2012, 02:58 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,204
Default Re: Ability to compare record to next record in data source

This is easy in FusionPro 8:
Code:
if (FieldChanged("Your Field Name))
     FusionPro.Composition.OpenNewOutputFile();
__________________
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
  #3  
Old August 22nd, 2012, 03:06 PM
Reino Reino is offline
Forum n00b
 
Join Date: Aug 2012
Posts: 2
Default Re: Ability to compare record to next record in data source

Is there any hope of doing this is we are still using version 4.2?
Reply With Quote
  #4  
Old August 22nd, 2012, 04:54 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,204
Default Re: Ability to compare record to next record in data source

Quote:
Originally Posted by Reino View Post
Is there any hope of doing this is we are still using version 4.2?
No. Well, at least not if you're really trying to output to multiple files. The ability to open a new output file at any given time ("arbitrary chunking") is new in FusionPro 8.0. In earlier versions, you could chunk the output to multiple files, but all the chunks (other than the first and last) had to be the same size (same number of records). The only way to do what I think you're trying to do in those older versions is to break up the input file and do multiple compositions.

However, if what you're trying to do is aggregate all the records from the data into a single output record, you can do that by opening the data file with ExternalDataFileEx, then you can iterate through it and do pretty much whatever you want. This should work even in older versions.

At any rate, you should really consider upgrading. FusionPro 4.2 is five years old. It predates the very first iPhone.
__________________
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
  #5  
Old October 22nd, 2012, 01:13 PM
ehigginbotham ehigginbotham is offline
Junior Community Member
 
Join Date: Jun 2009
Posts: 34
Default Re: Ability to compare record to next record in data source

Can the same idea be used to turn on an unused body page when a field changes?

if (FieldChanged(Field("fieldname")))
FusionPro.Composition.SetBodyPageUsage("test",true );

Its not working for me, but I just thought it might be useful if it could.

thanks
__________________
Eric Higginbotham
FP 9.1.0 Windows 7
Reply With Quote
  #6  
Old October 22nd, 2012, 01:50 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,204
Default Re: Ability to compare record to next record in data source

Quote:
Originally Posted by ehigginbotham View Post
Can the same idea be used to turn on an unused body page when a field changes?

if (FieldChanged(Field("fieldname")))
FusionPro.Composition.SetBodyPageUsage("test", true);

Its not working for me, but I just thought it might be useful if it could.
Yes, that idea should work in general. But your first line is wrong; you don't want to call the Field function inside the FieldChanged() call. I highlighted the parts you need to remove above in Red.

So the rule should look like this:
Code:
if (FieldChanged("fieldname"))
    FusionPro.Composition.SetBodyPageUsage("test",true);
Or, more simply, like this:
Code:
FusionPro.Composition.SetBodyPageUsage("test", FieldChanged("fieldname"));
__________________
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 October 22nd, 2012, 02:00 PM
ehigginbotham ehigginbotham is offline
Junior Community Member
 
Join Date: Jun 2009
Posts: 34
Default Re: Ability to compare record to next record in data source

that worked great.

thanks
__________________
Eric Higginbotham
FP 9.1.0 Windows 7
Reply With Quote
Reply

Tags
multiple records, rules

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 01:36 PM.


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