So right now we are sending the report per email or we are printing and sending it to the customer.
Additionally we need to save the report in a directory.
Therefore we open the report again, go on print and select pdf.
The filename is always "Report"+[ReportID].pdf.
What I like to do is to save the report as "Invoice"+[Sales_Invoice_Header_No.].pdf in background when I send the report per email or print the report.
I was looking for a solution and I have found the SaveAsPdf function, but I wasn't able to make it work.
Since I only need the function for the invoice report, is it possible to use this function in the C/AL Editor or do I need to create a Codeunit (while looking for more information to the SaveAsPdf function I came across Codeunit)?
It would be really nice if someone could show me an example of how to use the function.
*This post is locked for comments