microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
763 stars 608 forks source link

[Extensiblity Bug] report 1308 "Standard Sales - Shipment" LogDocument - Wrong Document Type #24036

Closed pri-kise closed 1 year ago

pri-kise commented 1 year ago

🕮 Describe the request It seems like there was some problem in creating the new reports.

LogDocument shoul probably use 5 or Enum::"Interaction Log Entry Document Type"::"Sales Shpt. Note".AsInteger() similiar to the old shipment report (report 208 "Sales - Shipment").

Could you please fix this, that we can create ReportExtensions instead of copies of this report.

Additional context

trigger OnPostReport()
begin
    if LogInteraction and not IsReportInPreviewMode() then
        if Header.FindSet() then
            repeat
                if Header."Bill-to Contact No." <> '' then
                    SegManagement.LogDocument(
                        4, Header."No.", 0, 0, DATABASE::Contact, Header."Bill-to Contact No.", Header."Salesperson Code",
                        Header."Campaign No.", Header."Posting Description", '')
                else
                    SegManagement.LogDocument(
                        4, Header."No.", 0, 0, DATABASE::Customer, Header."Bill-to Customer No.", Header."Salesperson Code",
                        Header."Campaign No.", Header."Posting Description", '');
            until Header.Next() = 0;
end;

https://github.com/StefanMaron/MSDyn365BC.Code.History/blob/0a1899ca2646c262f9bbaea49b617355a7939912/BaseApp/Source/Base%20Application/SalesReceivables/Document/StandardSalesShipment.Report.al#L812C1-L819C84

pri-kise commented 1 year ago

Solved via BaseApp pilot