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 September 19th, 2018, 12:43 PM
mjlongo mjlongo is offline
Junior Community Member
 
Join Date: Jul 2013
Location: Rochester NY
Posts: 47
Default Limit the number of records read

Hello, I have a situation where the user might supply a file with say 100 records. Can I setup a rule or script whereby the system will stop reading records after say the 20th record? I do not want to have to manually remove records from the proved file. I want to ensure it never goes above whatever limit I end up setting it at.

As a side note: If I set the Record Range on the input tab of the compose settings screen, does this setting remain in place for a fusion pro doc that is "collected" for a Marcom portal?

Thanks!
Reply With Quote
  #2  
Old September 19th, 2018, 01:47 PM
ScottHillock ScottHillock is offline
Regular Contributor
 
Join Date: Mar 2010
Posts: 94
Default Re: Limit the number of records read

I have not used Marcom, but to answer the first part of your question, this will work:

Code:
var RecordLimit = 20;
if (FusionPro.Composition.inputRecordNumber > RecordLimit){FusionPro.Composition.composeThisRecord = false;}
Reply With Quote
  #3  
Old September 19th, 2018, 02:20 PM
mjlongo mjlongo is offline
Junior Community Member
 
Join Date: Jul 2013
Location: Rochester NY
Posts: 47
Default Re: Limit the number of records read

Thanks! I'll give it a shot.
Reply With Quote
  #4  
Old September 20th, 2018, 06:02 AM
mjlongo mjlongo is offline
Junior Community Member
 
Join Date: Jul 2013
Location: Rochester NY
Posts: 47
Default Re: Limit the number of records read

BTW, does that script go in the OnJobStart or OnRecordStart?
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 04:03 PM.


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