You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simular to issue #26369
I'd like to be able to modify the new Job Planning Line.
local procedure CreateJobPlanningLine(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; JobContractEntryNo: Integer): Integer
var
JobPlanningLine: Record "Job Planning Line";
NewJobPlanningLine: Record "Job Planning Line";
JobPlanningLineInvoice: Record "Job Planning Line Invoice";
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeCreateJobPlanningLine(SalesHeader, SalesLine, JobContractEntryNo, IsHandled);
if IsHandled then
exit;
JobPlanningLine.SetCurrentKey("Job Contract Entry No.");
JobPlanningLine.SetRange("Job Contract Entry No.", JobContractEntryNo);
if JobPlanningLine.FindFirst() then begin
NewJobPlanningLine.InitFromJobPlanningLine(JobPlanningLine, SalesLine.Quantity);
OnCreateJobPlanningLineOnAfterInitFromJobPlanningLine(NewJobPlanningLine, JobPlanningLine, SalesLine); // New event
JobPlanningLineInvoice.InitFromJobPlanningLine(NewJobPlanningLine);
JobPlanningLineInvoice.InitFromSales(SalesHeader, SalesHeader."Posting Date", SalesLine."Line No.");
JobPlanningLineInvoice.Insert();
NewJobPlanningLine.UpdateQtyToTransfer();
NewJobPlanningLine.Insert();
end;
exit(NewJobPlanningLine."Job Contract Entry No.");
end;
Event signature:
[IntegrationEvent(false, false)]
local procedure OnCreateJobPlanningLineOnAfterInitFromJobPlanningLine(var NewJobPlanningLine: Record "Job Planning Line"; JobPlanningLine: Record "Job Planning Line"; SalesLine: Record "Sales Line")
begin
end;
Additional context
I'd like to update the newly created Job Planning Line with information from the new sales line. Currently the only way I found is to use event OnBeforeCopySalesJobFields and use IsHandled = true and copy code from CopySalesJobFields() and CreateJobPlanningLine() to our project and add our code to it.
The text was updated successfully, but these errors were encountered:
Describe the request
Simular to issue #26369
I'd like to be able to modify the new Job Planning Line.
Event signature:
Additional context
I'd like to update the newly created Job Planning Line with information from the new sales line. Currently the only way I found is to use event OnBeforeCopySalesJobFields and use IsHandled = true and copy code from CopySalesJobFields() and CreateJobPlanningLine() to our project and add our code to it.
The text was updated successfully, but these errors were encountered: