1 Reply Latest reply on Jul 13, 2017 10:28 AM by philmodjunk

    Printing unstored calculations / global variable


      I  want to print (to PDF) a letter to multiple people.


      The names of these people are calculated by "Title", "Initials", "middle name" and "last name"  into $$fullName, using the IF function.

      On my layout page there is a textfield with a merge variable <<$$fullNam>>.

      The $$fullNam is calculated onRecordLoad by a script by using Set Variable...


      When scrolling through the records, everything looks okay. But when I print I only get the fullName of the first record on all printed pages.


      What am I doing wrong?


      ( I don't want to store the fullnames in the database. )

        • 1. Re: Printing unstored calculations / global variable

          You are using a global variable so you see the same value on every record, that's what a global variable is defined to do. You don't indicate how the global variable is updated for each page, but assuming that you use a script and you are printing using the "records being browsed" option, your script isn't being performed to update the variable on each new record and thus you get the same name on every page.


          You'd need to print one record at a time with the script updating the variable between each print job. A looping script can still make this something done by a single mouse click.


          But you might replace your merge variable with an unstored calculation field defined in the same record as the data you are currently putting in the variable. Then it will automatically show the correct name on each page no matter how you print or save as PDF.