Introduction: In this blog, I will be giving the procedure to save the selected Posted Sales Invoice as a PDF document in a particular mentioned path.
Microsoft Dynamics NAV
FileName := FileMgt.ServerTempFileName('PDF');
IF SalesInvoiceHeader.FINDFIRST THEN BEGIN
I have entered the required report ID in a newly created custom setup table. From that table, I am fetching the Report ID. The standard sales invoice report ID is 206. If you have a customized report you need to enter the respective customized report ID.
Save the folder path in a variable FolderPath. You can enter the Folder path in a newly created custom table and fetch it from there.
You can create customized folders using C/AL code according to the posting date of the Posted Sales Invoice as mentioned in my previous blog using the link below and save the customized folder name in a FolderName variable.
Procedure to create custom folders in a specific location using C/AL code in Dynamics NAV
This will save the required Posted Sales Invoice record report in the mentioned location.