GetReport(VAR SalesHeader : Record "Sales Header") WITH SalesHeader DO BEGIN CASE "Document Type" OF "Document Type"::Order: BEGIN IF Ship THEN BEGIN SalesShptHeader."No." := "Last Shipping No."; SalesShptHeader.SETRECFILTER; PrintReport(ReportSelection.Usage::"S.Shipment"); END; IF Invoice THEN BEGIN SalesInvHeader."No." := "Last Posting No."; SalesInvHeader.SETRECFILTER; // PrintReport(ReportSelection.Usage::"S.Invoice"); END; Customer.RESET; Customer.SETRANGE(Customer."No.","Sell-to Customer No."); Customer.SETRANGE(Customer."Do Not Print Amount",FALSE); IF Customer.FIND('-') THEN BEGIN PrintReport(ReportSelection.Usage::"S.Invoice"); END; END;
Comments
I love the Smilies! Merry Christmas to all of you!
Andwian
Your code is in wrong block. It will be called regardless you are trying to print shipment or invoice...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Andwian