ALAppExtensions
ALAppExtensions copied to clipboard
[Event Request] Table 1003 "Job Planning Line" - function InitFromJobPlanningLine
Hello,
We have added functionality to the jobs part of Dynamics BC which adds some fields to the Job Planning Line as they are also needed for filtering. These fields should not be transferred in the function below so we would like to have an event added to table 1003 "Job Planning Line" in the function InitFromJobPlanningLine.
Thanx in advance..
procedure InitFromJobPlanningLine(FromJobPlanningLine: Record "Job Planning Line"; NewQuantity: Decimal)
var
ToJobPlanningLine: Record "Job Planning Line";
JobJnlManagement: Codeunit JobJnlManagement;
begin
ToJobPlanningLine := Rec;
ToJobPlanningLine.Init();
ToJobPlanningLine.TransferFields(FromJobPlanningLine);
ToJobPlanningLine."Line No." := GetNextJobLineNo(FromJobPlanningLine);
ToJobPlanningLine.Validate("Line Type", "Line Type"::Billable);
ToJobPlanningLine.ClearValues;
ToJobPlanningLine."Job Contract Entry No." := JobJnlManagement.GetNextEntryNo;
if ToJobPlanningLine.Type <> ToJobPlanningLine.Type::Text then begin
ToJobPlanningLine.Validate(Quantity, NewQuantity);
ToJobPlanningLine.Validate("Currency Code", FromJobPlanningLine."Currency Code");
ToJobPlanningLine.Validate("Currency Date", FromJobPlanningLine."Currency Date");
ToJobPlanningLine.Validate("Currency Factor", FromJobPlanningLine."Currency Factor");
ToJobPlanningLine.Validate("Unit Cost", FromJobPlanningLine."Unit Cost");
ToJobPlanningLine.Validate("Unit Price", FromJobPlanningLine."Unit Price");
end;
------------------------ Code to add - start ------------------------
OnAfterInitFromJobPlanningLine(ToJobPlanningLine, FromJobPlanningLine);
------------------------ Code to add - end ------------------------
Rec := ToJobPlanningLine;
end;
[IntegrationEvent(false, false)]
local procedure OnInitFromJobPlanningLine(var ToJobPlanningLine: Record "Job Planning Line"; FromJobPlanningLine: Record "Job Planning Line")
begin
end;
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.