Hello dear community!
Having a problem using SaveAsPdf function, don't know what's missing.
So I added trigger OnAfterAction in Post Action in Sales Order.
PdfFileName is being generated correctly, it gets the right No., Posting Date and Sell-to Customer Name from the order, but Report.SaveAsPdf function saves report from the first Sales Order in the list.