0

printandsaverecord - How do I stop from overriding attachment?

  • I have a separate form interface (table) linked to the table 'CLIENT'
  • On my form I have coded a button with:
importFile('CLIENT', printAndSaveRecord(this, "AP Sign Out"), 'AP SIGNOUT CONFIRMATION' + ".pdf")
  • This works perfectly to capture the information I have inputted through my Form and then attaches the printed form to the linked 'CLIENT' record.
  • However, I would like to be able to create a new saved record to the target 'CLIENT' record everytime I click the button rather than have it overwrite the existing attachment.
  • Is this possible?

2 replies

null
    • John_Halls
    • 10 days ago
    • Reported - view

    Hi  Suzie I would either add a field to your table that you increment after each pdf creation, and append it to the filename. If the field is called pdfCounter then you code becomes

    importFile('CLIENT', printAndSaveRecord(this, "AP Sign Out"), 'AP SIGNOUT CONFIRMATION' + format(pdfCounter,"000" + ".pdf");
    pdfCounter := pdfCounter + 1
    

    Or use a timestamp in the name using now()

    importFile('CLIENT', printAndSaveRecord(this, "AP Sign Out"), 'AP SIGNOUT CONFIRMATION' + " " + now()+ ".pdf")
    

    Regards John

    • Suzie_Konszky
    • 9 days ago
    • Reported - view

    Great! works. Thanks 🙂

Content aside

  • Status Answered
  • 9 days agoLast active
  • 2Replies
  • 23Views
  • 2 Following