MarcomCentral (PTI) and FusionPro User Communities

MarcomCentral (PTI) and FusionPro User Communities (http://forums.pti.com/index.php)
-   FusionPro® VDP Creator (http://forums.pti.com/forumdisplay.php?f=5)
-   -   Issue with OpenNewOutputFile (http://forums.pti.com/showthread.php?t=5353)

Stack May 15th, 2019 07:42 AM

Issue with OpenNewOutputFile
 
Hello all, I'm having a small issue with a rule to output a new file during composition, based on a field. Below is my code:
Code:

if (FieldChanged("traymark_"))
    FusionPro.Composition.OpenNewOutputFile("63110_MM_SummerNewsletter2019_ADDRESSED_" + Field("sequence") + "_" + FusionPro.Composition.outputFormatExtension);

The traymark_ field uses a double-asterisk to indicate a new tray. The issue is that with the above rule, a new file is output every time there's a change in that field. So for each double-asterisk record, a new file is output, and then another new file is output for those blank records that follow in the traymark_ field, until the next record with a double-asterisk. Basically, I'm getting double the amount of output files than I intend. Ideally, each new file that's output would include the double-asterisk record AND all blank traymark_ records that follow, until the next double-asterisk traymark_ record, which would output a new file.

Is there a way to append the code above, or should I be using a different code? Thanks!

Dan Korn May 15th, 2019 01:07 PM

Re: Issue with OpenNewOutputFile
 
Change the first line to:
Code:

if (Field("traymark_") == "**")

Stack May 15th, 2019 01:21 PM

Re: Issue with OpenNewOutputFile
 
Thanks for the reply Dan, works perfectly!


All times are GMT -7. The time now is 04:30 AM.

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