Print to File with Invoice Number
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.
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.
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);
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
- 2 mths agoLast active