Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Request] - Table Sales Line - Function InitDeferralCode #27849

Open
DanielHaglo opened this issue Dec 23, 2024 · 0 comments
Open

[Event Request] - Table Sales Line - Function InitDeferralCode #27849

DanielHaglo opened this issue Dec 23, 2024 · 0 comments
Labels
event-request Request for adding an event Finance GitHub request for Finance area

Comments

@DanielHaglo
Copy link

DanielHaglo commented Dec 23, 2024

Describe the request

local procedure InitDeferralCode()
    var
        Item: Record Item;
        IsHandled: Boolean;
        ShouldUpdateDeferralCode: Boolean;
    begin
        IsHandled := false;
        OnBeforeInitDeferralCode(Rec, IsHandled);
        if IsHandled then
            exit;
        
       ShouldUpdateDeferralCode := SalesLine."Document Type" in [SalesLine."Document Type"::Order, SalesLine."Document Type"::Invoice, SalesLine."Document Type"::"Credit Memo", SalesLine."Document Type"::"Return Order"];
        OnBeforeUpdateDeferralCode(SalesLine, ShouldUpdateDeferralCode);
        if ShouldUpdateDeferralCode then
            case Type of
                Type::"G/L Account":
                    Validate("Deferral Code", GLAcc."Default Deferral Template Code");
                Type::Item:
                    begin
                        GetItem(Item);
                        Validate("Deferral Code", Item."Default Deferral Template Code");
                    end;
                Type::Resource:
                    Validate("Deferral Code", Res."Default Deferral Template Code");
            end;
    end;

Additional context

We want to be able to set deferral code when document type is quote. Is it possible for the function to look something like this? :)
Internal work item: AB#561284

@JakovljevicDusan JakovljevicDusan added event-request Request for adding an event Finance GitHub request for Finance area labels Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-request Request for adding an event Finance GitHub request for Finance area
Projects
None yet
Development

No branches or pull requests

2 participants