alguidelines/content/docs/NAVPatterns/3-cal-coding-guidelines/readability/nested-withs/index.md
2022-02-20 13:18:49 +01:00

406 B

+++ title = "Nested WITHs" weight = 850 +++ Do not nest WITHs that reference different types of objects.

Bad code

WITH PostedWhseShptLine DO BEGIN
  ...
  WITH ItemLedgEntry DO
    InsertBufferRec(...,"Serial No.","Lot No.",...);
    ...
END;

Good code

WITH PostedWhseShptLine DO BEGIN
  ...
  InsertBufferRec(...,ItemLedgEntry."Serial No.",ItemLedgEntry."Lot No.",...);
  ...
END;