He’s a replay from a post that asks basically the same question.
I needed to run a report (#50065) from a PO that would update some sales lines.
All I wanted is that the PO# appeared in the report so no user intervention was needed.
The only way I could do it was on the c/al code of the button
then I added to Codeunit229 (Document-Print) a function called UpdateSalesLines
But it’s the last 3 lines of code that gets your report going & without a dev license you would need to have your nsc do this for you.
UpdateSalesLines(PurchHeader : Record “Purchase Header”)
PurchLine.SETRANGE(“Document Type”,PurchHeader.“Document Type”);