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] Page 171 "Standard Sales Code Subform" - OnValidateDescriptionOnBeforeChangeSalesLineType #28017

Open
Kerubis opened this issue Jan 30, 2025 · 0 comments

Comments

@Kerubis
Copy link

Kerubis commented Jan 30, 2025

Describe the request

Please add new event:

Previous code:

field(Description; Rec.Description)
{
    ApplicationArea = Suite;
    ToolTip = 'Specifies a description of the entry, which is based on the contents of the Type and No. fields.';

    trigger OnValidate()
    begin
        if Rec.Description = xRec.Description then
            exit;
    
        if Rec."No." = '' then
            Rec.Type := Rec.Type::" ";
        UpdateTypeText();
    end;
}

New code:

field(Description; Rec.Description)
{
    ApplicationArea = Suite;
    ToolTip = 'Specifies a description of the entry, which is based on the contents of the Type and No. fields.';
    
    trigger OnValidate()
    var
        IsHandled: Boolean;
    begin
        if Rec.Description = xRec.Description then
            exit;
    
        IsHandled := false;
        OnValidateDescriptionOnBeforeChangeSalesLineType(Rec, IsHandled);
        if IsHandled then
            exit;
    
        if Rec."No." = '' then
            Rec.Type := Rec.Type::" ";
        UpdateTypeText();
    end;
}

Event:

    [IntegrationEvent(false, false)]
    local procedure OnValidateDescriptionOnBeforeChangeSalesLineType(var StandardSalesLine: Record "Standard Sales Line"; var IsHandled: Boolean)
    begin
    end;

Additional context

When new "Sales Line Type" are added, they are overwritten if "No." is empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant