-
Notifications
You must be signed in to change notification settings - Fork 687
Description
Why do you need this change?
Our customers want the extended text feature to work similiar to the Sales Documents where they have on Date Field at the header level that controls which extended texts are found.
Therefore we need a way to change the DocDate that is used when ReadExtTextLines is called for a JobPlanningLine.
Describe the request
Could you update the event OnJobCheckIfAnyExtTextOnBeforeReadExtTextLines to provide a way to overwrite the "Document Date" that is used to check for extended texts in procedure JobCheckIfAnyExtText?
procedure JobCheckIfAnyExtText(var JobPlanningLine: Record "Job Planning Line"; Unconditionally: Boolean; Job: Record Job) Result: Boolean
var
ExtTextHeader: Record "Extended Text Header";
IsHandled: Boolean;
DocDate: Date;
begin
...
case JobPlanningLine.Type of
JobPlanningLine.Type::Text:
ExtTextHeader.SetRange("Table Name", ExtTextHeader."Table Name"::"Standard Text");
JobPlanningLine.Type::Item:
ExtTextHeader.SetRange("Table Name", ExtTextHeader."Table Name"::Item);
JobPlanningLine.Type::Resource:
ExtTextHeader.SetRange("Table Name", ExtTextHeader."Table Name"::Resource);
JobPlanningLine.Type::"G/L Account":
ExtTextHeader.SetRange("Table Name", ExtTextHeader."Table Name"::"G/L Account");
end;
ExtTextHeader.SetRange("No.", JobPlanningLine."No.");
ExtTextHeader.SetRange(Job, true);
//+Change
//-OnJobCheckIfAnyExtTextOnBeforeReadExtTextLines(ExtTextHeader, Job, JobPlanningLine, Unconditionally, MakeUpdateRequired);
//-exit(ReadExtTextLines(ExtTextHeader, JobPlanningLine."Document Date", Job."Language Code"));
DocDate := JobPlanningLine."Document Date";
OnJobCheckIfAnyExtTextOnBeforeReadExtTextLines(ExtTextHeader, Job, JobPlanningLine, Unconditionally, MakeUpdateRequired, DocDate);
exit(ReadExtTextLines(ExtTextHeader, DocDate, Job."Language Code"));
//-Change
end;
[IntegrationEvent(false, false)]
//+Change
//-local procedure OnJobCheckIfAnyExtTextOnBeforeReadExtTextLines(var ExtendedTextHeader: Record "Extended Text Header"; var Job: Record Job; var JobPlanningLine: Record "Job Planning Line"; Unconditionally: Boolean; var MakeUpdateRequired: Boolean)
local procedure OnJobCheckIfAnyExtTextOnBeforeReadExtTextLines(var ExtendedTextHeader: Record "Extended Text Header"; var Job: Record Job; var JobPlanningLine: Record "Job Planning Line"; Unconditionally: Boolean; var MakeUpdateRequired: Boolean; var DocDate: Date)
//-Change
begin
end;
Internal work item: AB#613386