Skip to content

Commit

Permalink
Refactor code to conditionally insert record
Browse files Browse the repository at this point in the history
Instead of unconditionally inserting a record, the change introduces a conditional check before insertion to improve control flow. This alteration enhances the validation process during record creation.
  • Loading branch information
DmitryKatson committed Sep 17, 2024
1 parent 7c98b5d commit 4a85163
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ codeunit 324 "No. Series Copilot Impl."
Json.GetValueAndSetToRecFieldNo(RecRef, 'nextYear', GeneratedNoSeries.FieldNo("Is Next Year"));
Json.GetValueAndSetToRecFieldNo(RecRef, 'exists', GeneratedNoSeries.FieldNo(Exists));
Json.GetValueAndSetToRecFieldNo(RecRef, 'message', GeneratedNoSeries.FieldNo(Message));
RecRef.Insert(true);
if RecRef.Insert(true) then;

ValidateGeneratedNoSeries(RecRef);
end;
Expand Down

0 comments on commit 4a85163

Please sign in to comment.