-
Notifications
You must be signed in to change notification settings - Fork 682
Open
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 new integration events in the Sales-Post codeunit, which concerns job related operations. As this check is executed for every 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 events will be subscribed using manual subscription to skip these costly executions for each line.
Describe the request
Object: codeunit 80 "Sales-Post"
Procedure: ArchiveRelatedJob
Code:
#if NEWEVENTS
[IntegrationEvent(false, false)]
local procedure OnBeforeArchiveRelatedJob(SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
begin
end;
#endif
local procedure ArchiveRelatedJob(SalesHeader: Record "Sales Header")
var
Job: Record Job;
SalesLine: Record "Sales Line";
JobArchiveManagement: Codeunit "Job Archive Management";
#if NEWEVENTS
IsHandled: Boolean;
begin
OnBeforeArchiveRelatedJob(SalesHeader, IsHandled);
if IsHandled then
exit;
#endif
SalesLine.SetRange("Document Type", SalesHeader."Document Type");
SalesLine.SetRange("Document No.", SalesHeader."No.");
SalesLine.SetFilter("Job No.", '<>%1', '');
if not SalesLine.FindFirst() then
exit;
if Job.Get(SalesLine."Job No.") then
JobArchiveManagement.AutoArchiveJob(Job);
end;
Internal work item: AB#610440
Metadata
Metadata
Assignees
Labels
SCMGitHub request for SCM areaGitHub request for SCM areaevent-requestRequest for adding an eventRequest for adding an event