I have already found the solution to my problem, but I don’t understand why my original code doesn’t work. On page 143 (Posted Sales Invoices), I would like to create a PDF of all sales invoices that are selected by the user. The below code does not work however the code below that does work. Can someone please explain to me why?
Code that doesn’t work
…(get the page selection etc and put into pSalesInvoice)…
Thanks for your reply Neil, but that is exactly as the code already read.
It seems to me before a report is called a SETRANGE has to be done to the record before sending it to the report. Not really sure why. (That is a GET by itself doesn’t seem to work nor does a FINDFIRST/FINDSET and scrolling through them.)
When you execute a report with SAVEASPDF, then it’s just as if you execute it with a RUN. If you run it with the record variable, then it will run using the filters applied to the record variable. With no filters, then it would basically save/print all invoices. That is presuming your invoice report is or works similar to the standard invoice.