alguidelines/content/BCBestPractices/Readability/variables-declarations-order/index.md
christianbraeunlich a355c847d9 fixed typo
2022-02-10 16:06:41 +01:00

1.2 KiB

+++ title = "Variables Declarations Order" weight = 1430 +++

<Created by Microsoft, Described by waldo>

Description

Variables declarations should be ordered by type. In general, object and complex variable types are listed first followed by simple variables. The order should be:

  • Record
  • Report
  • Codeunit
  • XmlPort
  • Page
  • Query
  • Notification
  • BigText
  • DateFormula
  • RecordId
  • RecordRef
  • FieldRef
  • FilterPageBuilder

(Ref: Microsoft Docs)

Bad code

    StartingDateFilter: Text;
    Vendor: Record Vendor;

Good code

    Vendor: Record Vendor;
    StartingDateFilter: Text;

Discussions

You can find discussions on all "Best Practices" here.

If you don't find the discussion of this guideline, please feel free to create a new one with the same title as this article.