Skip to content

Commit

Permalink
added: explicit validation of customer related fields
Browse files Browse the repository at this point in the history
  • Loading branch information
plakna committed Oct 24, 2024
1 parent 7294528 commit b621466
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,7 @@ codeunit 6610 "FS Int. Table Subscriber"
end;
'FS Work Order-Service Header':
begin
ValidateServiceHeaderAfterInsert(DestinationRecordRef);
ResetServiceOrderItemLineFromFSWorkOrderIncident(SourceRecordRef, DestinationRecordRef, ArchivedServiceOrders);
ResetServiceOrderLineFromFSWorkOrderProduct(SourceRecordRef, DestinationRecordRef, ArchivedServiceOrders);
ResetServiceOrderLineFromFSWorkOrderService(SourceRecordRef, DestinationRecordRef, ArchivedServiceOrders);
Expand Down Expand Up @@ -992,6 +993,16 @@ codeunit 6610 "FS Int. Table Subscriber"
end;
end;

local procedure ValidateServiceHeaderAfterInsert(DestinationRecordRef: RecordRef)
var
ServiceHeader: Record "Service Header";
begin
DestinationRecordRef.SetTable(ServiceHeader);
ServiceHeader.Validate("Customer No."); // explicit recalculation, as InitRecord() was called after setting the customer
ServiceHeader.Modify(true);
DestinationRecordRef.GetTable(ServiceHeader);
end;

local procedure ResetServiceOrderItemLineFromFSWorkOrderIncident(SourceRecordRef: RecordRef; DestinationRecordRef: RecordRef; var ArchivedServiceOrders: List of [Code[20]])
var
ServiceHeader: Record "Service Header";
Expand Down

0 comments on commit b621466

Please sign in to comment.