ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Table 37 "Sales Line", Function InitType; OnInitTypeOnBeforeAssignType

Open nd2403 opened this issue 5 years ago • 1 comments

Hello, we need to influence the assignment of record type. Thank you in advance.

    procedure InitType()
    var
// - new
        IsHandled: Boolean;
// + new
    begin
        if "Document No." <> '' then begin
            if not SalesHeader.Get("Document Type", "Document No.") then
                exit;
            if (SalesHeader.Status = SalesHeader.Status::Released) and
               (xRec.Type in [xRec.Type::Item, xRec.Type::"Fixed Asset"])
            then
                Type := Type::" "
// - change
            // else
            else begin
                IsHandled := false;
                OnInitTypeOnBeforeAssignType(Rec, xRec, IsHandled);
                if not IsHandled then
// + change
                    Type := xRec.Type;
            end;
        end;

        OnAfterInitType(Rec, xRec, SalesHeader);
    end;
    [IntegrationEvent(false, false)]
    local procedure OnInitTypeOnBeforeAssignType(var SalesLine: Record "Sales Line"; var xSalesLine: Record "Sales Line"; var IsHandled: Boolean)
    begin
    end;

nd2403 avatar Nov 23 '21 14:11 nd2403

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.

JesperSchulz avatar Nov 29 '21 06:11 JesperSchulz