-
Notifications
You must be signed in to change notification settings - Fork 682
Open
Open
Copy link
Labels
SCMGitHub request for SCM areaGitHub request for SCM areaevent-requestRequest for adding an eventRequest for adding an event
Description
Why do you need this change?
We would like to request a new integration event in the CanHandleLine procedure to allow for custom logic to determine whether a Sales Line should be processed in the Booking logic. As this check is executed for every single invoice line being posted, the overhead for bulk operations is incredibly high, even though the functionality is not in use by any of our customers. To improve performance during our bulk posting operations, the event will be subscribed using manual subscription to skip these costly executions for each line.
Describe the request
Object: codeunit 6721 "Booking Manager"
Procedure: CanHandleLine
Current Code:
local procedure CanHandleLine(var SalesLine: Record "Sales Line"): Boolean
begin
if SalesLine.IsTemporary then
exit(false);
if SalesLine."Document Type" <> SalesLine."Document Type"::Invoice then
exit(false);
exit(true);
end;
New Code:
[IntegrationEvent(false, false)]
local procedure OnCanHandleLine(var SalesLine: Record "Sales Line"; var HandleLine: Boolean; var IsHandled: Boolean)
begin
end;
local procedure CanHandleLine(var SalesLine: Record "Sales Line") HandleLine: Boolean
var
IsHandled: Boolean;
begin
if SalesLine.IsTemporary then
exit(false);
OnCanHandleLine(SalesLine, HandleLine, IsHandled);
if IsHandled then
exit;
if SalesLine."Document Type" <> SalesLine."Document Type"::Invoice then
exit(false);
exit(true);
end;
Internal work item: AB#610409
Metadata
Metadata
Assignees
Labels
SCMGitHub request for SCM areaGitHub request for SCM areaevent-requestRequest for adding an eventRequest for adding an event