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 9ee90d2
Showing 1 changed file with 33 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 Expand Up @@ -2774,4 +2785,26 @@ codeunit 6610 "FS Int. Table Subscriber"
local procedure OnSetUpNewLineOnNewLine(var JobJournalLine: Record "Job Journal Line"; var JobJournalTemplate: Record "Job Journal Template"; var JobJournalBatch: Record "Job Journal Batch"; var Handled: Boolean);
begin
end;


[EventSubscriber(ObjectType::Table, Database::"Service Header", 'OnAfterCopyBillToCustomerFields', '', false, false)]
local procedure MyProcedure0()
begin

end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Integration Record Synch.", 'OnBeforeIsFieldModified', '', false, false)]
local procedure MyProcedure1()
begin
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Integration Rec. Synch. Invoke", 'OnAfterInsertRecord', '', false, false)]
local procedure MyProcedure2()
begin
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"CRM Integration Table Synch.", 'OnBeforeRun', '', false, false)]
local procedure MyProcedure3()
begin
end;
}

0 comments on commit 9ee90d2

Please sign in to comment.