microsoft / ALAppExtensions

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

[Event Request] table 295 "Reminder Header" - OnAfterAssignCustomerValues #13363

Closed Duizy05 closed 3 years ago

Duizy05 commented 3 years ago

We would like to add a new event OnAfterAssignCustomerValues in the following trigger:

        trigger OnValidate()
        var
            Cont: Record Contact;
        begin
            if CurrFieldNo = FieldNo("Customer No.") then
                if Undo then begin
                    "Customer No." := xRec."Customer No.";
                    CreateDim(DATABASE::Customer, "Customer No.");
                    exit;
                end;
            if "Customer No." = '' then begin
                CreateDim(DATABASE::Customer, "Customer No.");
                exit;
            end;
            Cust.Get("Customer No.");
            if Cust."Privacy Blocked" then
                Cust.CustPrivacyBlockedErrorMessage(Cust, false);
            CheckCustomerBlockedAll(Cust);

            if Cont.Get(Cust."Primary Contact No.") then
                Cont.CheckIfPrivacyBlockedGeneric();

            Name := Cust.Name;
            "Name 2" := Cust."Name 2";
            Address := Cust.Address;
            "Address 2" := Cust."Address 2";
            "Post Code" := Cust."Post Code";
            City := Cust.City;
            County := Cust.County;
            Contact := Cust.Contact;
            "Country/Region Code" := Cust."Country/Region Code";
            "Language Code" := Cust."Language Code";
            "Currency Code" := Cust."Currency Code";
            "Shortcut Dimension 1 Code" := Cust."Global Dimension 1 Code";
            "Shortcut Dimension 2 Code" := Cust."Global Dimension 2 Code";
            "VAT Registration No." := Cust."VAT Registration No.";
            Cust.TestField("Customer Posting Group");
            "Customer Posting Group" := Cust."Customer Posting Group";
            "Gen. Bus. Posting Group" := Cust."Gen. Bus. Posting Group";
            "VAT Bus. Posting Group" := Cust."VAT Bus. Posting Group";
            "Tax Area Code" := Cust."Tax Area Code";
            "Tax Liable" := Cust."Tax Liable";
            "Reminder Terms Code" := Cust."Reminder Terms Code";
            "Fin. Charge Terms Code" := Cust."Fin. Charge Terms Code";
            OnAfterAssignCustomerValues(Rec, Cust); //A108F0065.Event
            Validate("Reminder Terms Code");

            CreateDim(DATABASE::Customer, "Customer No.");
        end;

Event Signature:

[IntegrationEvent(false, false)]
local procedure OnAfterAssignCustomerValues(var ReminderHeader: Record "Reminder Header"; Customer: Record Customer)
begin
    //A108F0065.Event
end;
JesperSchulz commented 3 years ago

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.