ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Extensibillity Request] - Copy Document Mgt. - OnAfterInitSalesLineFields

Open DanielHaglo opened this issue 3 months ago • 4 comments

Why do you need this change?

Could global variable RecalculateLines be added to this event?

OnAfterInitSalesLineFields(ToSalesLine,RecalculateLines);

Describe the request

InitSalesLineFields function is called in function SetDefaultValuesToSalesLine wich have event OnAfterSetDefaultValuesToSalesLine that have RecalculateLines.

I need to check RecalculateLines to do my logic. Internal work item: AB#646476

DanielHaglo avatar Aug 10 '26 12:08 DanielHaglo

Hi @DanielHaglo,

Thank you for your extensibility request. To help us process it efficiently, please update the issue to include the required information.

📚 Extensibility Guidelines

Missing Information:

  • Why the existing event is not sufficient: Please explain why OnAfterSetDefaultValuesToSalesLine(var ToSalesLine: Record "Sales Line"; ToSalesHeader: Record "Sales Header"; CreateToHeader: Boolean; RecalculateLines: Boolean; FromSalesLine: Record "Sales Line") does not work for your scenario, and why you specifically need RecalculateLines in OnAfterInitSalesLineFields.

Please update the issue with the missing details. We'll automatically re-analyze once updated.

[!NOTE] Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

[!TIP] Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

github-actions[bot] avatar Aug 10 '26 13:08 github-actions[bot]

Why the existing event is not sufficient: Please explain why OnAfterSetDefaultValuesToSalesLine(var ToSalesLine: Record "Sales Line"; ToSalesHeader: Record "Sales Header"; CreateToHeader: Boolean; RecalculateLines: Boolean; FromSalesLine: Record "Sales Line") does not work for your scenario, and why you specifically need RecalculateLines in OnAfterInitSalesLineFields.

The existing event is not sufficient because it does not cover copying from sales archive.

DanielHaglo avatar Aug 11 '26 06:08 DanielHaglo

✅ Analysis complete - ready for further processing


Implementation:

Add the RecalculateLines parameter to the OnAfterInitSalesLineFields integration event in InitSalesLineFields() and pass it in the event call.

Location in InitSalesLineFields() procedure:

        ToSalesLine."Shipped Not Invoiced (LCY)" := 0;
        ToSalesLine."Return Rcd. Not Invd. (LCY)" := 0;
        InitJobFieldsForSalesLine(ToSalesLine);

        OnAfterInitSalesLineFields(ToSalesLine, RecalculateLines);
    end;

Event Publisher (add at the end of the codeunit with other events):

    [IntegrationEvent(false, false)]
    local procedure OnAfterInitSalesLineFields(var SalesLine: Record "Sales Line"; RecalculateLines: Boolean)
    begin
    end;

File: CopyDocumentMgt.Codeunit.al

[!NOTE] Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

[!TIP] Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

github-actions[bot] avatar Aug 11 '26 07:08 github-actions[bot]

Please recreate your request in BCApps.

darjoo avatar Oct 05 '26 12:10 darjoo