Button to save a pdf when multiple print layouts are available
i have a form and multiple print layouts (that's because from the same data in the form, I need to have many different papers created).
1. Is there a way to add different buttons the form (one for each print layout), so that I can save the pdf (or print) without having to click on the printer icon, select the correct print layout and then export the pdf
That would be a huge time saver.
2. if point 1 is possibile, would it also be possible to set the path for the saved pdf?
Thank you all.
I would suggest to use a choice field, for example 'PrintLayout' with exactly the names of your printlayouts.
Then use something like this in your PRINT button:
let lay := text(PrintLayout);
importFile(this, printAndSaveRecord(this, lay), lay + Invoicenumber + ".pdf");
So it's maybe wise to call your printlayouts on how you want to call your PDF's also.
Maybe a API specialist can jump by this post?
I use some dedicated buttons for a common print layout ie a Delivery Note. The Other Notes button give a choice as per Steven's suggestion ie as per example
let result := dialog("Print Other Delivery Notes", "Print Part Order Delivery Note (YES) or Print Plain Note (NO)", ["Yes", "No"]);
if result = "Yes" then
printRecord(this, "Part Order Note")
if result = "No" then
printRecord(this, "Plain Note")
and my Parcel Label button does exactly what it says on the button - I could combine it all into one button but for my delivery notes I like the separate options.
No idea about point 2...