Hi
I have problem with PDF attachment file name for posted sales invoices.
My invoices are in format: INV/YEAR/NUMER like INV/2022/001.
If I go to "Actions > Attach as PDF" my pdf name will be "001.pdf", instead format "ReportName DocumentType DocumentNo" like "123456 Invoice INV/2022/001". Problem is with characters '/'
in document no.
I tried to replace all '/' characters with '-' using ConvertStr(), but I couldn't find any good event to subscribe. Every event I found pass fileName or DocumentNo as normal parameter without prefix var, to edit it as reference.
Code is in table 77 "Report Selections" in procedure "SaveDocumentAttachmentFromRecRef".
I tried to use events:
1.table 77 "Report Selections" > "OnBeforeSaveDocumentAttachmentFromRecRef"
2. table 1173 "DocumentAttachment" > "OnBeforeSaveAttachment"
but all pass parameter without prefix 'var'.
Is there any solution to change PDF fileName in code?