0

Print to File with Invoice Number

Hi, 

Could anyone tell me how to export to file from print to PDF with a particular field information in it? Such as Invoice Number? Thank you.

2 replies

null
    • John_Halls
    • 7 mths ago
    • Reported - view

    Hi

    If your print layout is called Invoices, try this

    importFile(this, printAndSaveRecord(this, "Invoices"), "Invoice " + invoiceNumber + ".pdf")
    

    It will save a copy of your invoice to the attachments.

    Regards John

    • Mel_Charles
    • 7 mths ago
    • Reported - view

    In my case I have a small image cell on the main page that I prefer to input into that cell

    ie say "delivery notes"

    so an example of my script from my Print Delivery Note button is 

    NoteImage := null;
    importFile(this, printAndSaveRecord(this, "118 Delivery Note"), "DN " + 'Job Ref' + ".pdf");
    let myPdf := printAndSaveRecord(this, "118 Delivery Note");
    let myName := "DN " + 'Job Ref' + ".pdf";
    importFile(this, myPdf, myName);
    waitForSync();
    NoteImage := myName

    The first line clears the image (even if it is empty). That way if i save the image and then want to make and edit and resave. I can ensure I always have the latest image.

    if you do it by the attachments page you can potentially end up with several many images 

Content aside

  • 7 mths agoLast active
  • 2Replies
  • 41Views
  • 3 Following