[Extensibillity Request] - Copy Document Mgt. - OnAfterInitSalesLineFields
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
Hi @DanielHaglo,
Thank you for your extensibility request. To help us process it efficiently, please update the issue to include the required information.
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 needRecalculateLinesinOnAfterInitSalesLineFields.
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.
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.
✅ 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.
Please recreate your request in BCApps.