...
IF "Line No." <> 0 THEN
DimMgt.UpdateJnlLineDefaultDim(
DATABASE::"Gen. Journal Line","Journal Template Name",
"Journal Batch Name","Line No.",0,
"Shortcut Dimension 1 Code","Shortcut Dimension 2 Code");
...
...
IF "Line No." <> 0 THEN BEGIN
DimMgt.UpdateJnlLineDefaultDim(
DATABASE::"Gen. Journal Line","Journal Template Name",
"Journal Batch Name","Line No.",0,
"Shortcut Dimension 1 Code","Shortcut Dimension 2 Code");
IF GenJnlLine2.GET("Journal Template Name","Journal Batch Name","Line No.") THEN
IF ("Shortcut Dimension 1 Code" <> GenJnlLine2."Shortcut Dimension 1 Code") OR
("Shortcut Dimension 2 Code" <> GenJnlLine2."Shortcut Dimension 2 Code")
THEN BEGIN
GenJnlLine2."Shortcut Dimension 1 Code" := "Shortcut Dimension 1 Code";
GenJnlLine2."Shortcut Dimension 2 Code" := "Shortcut Dimension 2 Code";
GenJnlLine2.MODIFY;
GET("Journal Template Name","Journal Batch Name","Line No.");
END;
END;
...