Naming Conventions

This document defines the naming conventions used to avoid naming conflicts when performing standard or specific development tasks. Some of the rules stated below are classified as strict recommendations and must be followed rigorously. Others are suggestions.

TypeRecommendations
StrictDictionary naming
StrictClass and Representation naming
StrictMethod naming
StrictLocal menu numbering
SuggestionScript naming
SuggestionCollection naming
SuggestionMenu items naming

Strict recommendations

Naming rules for dictionary elements

The elements listed below are all dictionary elements:

For these elements, the applicable rules are as follows:

Naming patternUse
A*Supervisor elements.
B* to T*, V*Standard elements.
U*Usually reserved for temporary tables used during updates.
W*Generated elements. Those are only generated by an automatic process. Modifying them manually is forbidden.
X*Add-on codes that might be developed outside of Sage.
Y*, Z*Specific elements developed outside of Sage.
QLFarea_caseTest cases for automated tests. It is good practice to group the unit tests of the same area by having a common prefix. The naming rules are:
  • A*: Reserved for Supervisor
    • AR: Runtime
  • CDA: Common Data
  • CDT: Continuous Delivery and Testing
  • CRM: Customer Relationship Management
  • EDI: Electronic Document Interface
  • FIN: Finance
  • FXD: Fixed Assets
  • GEO: WMS (geode)
  • HRM: HRM
  • MFG: Manufacturing
  • PAY: Payroll
  • PJM: Project Management
  • POR: RH Portal
  • PUR: Purchase
  • SAL: Sales
  • STK: Stock
  • W*: Generated test scripts
  • X*: Add-ons
  • Y*: Assets (vertical or specific development)
  • Z*: Assets (vertical or specific development)
For example, QLFAS_*.src is the pattern for Supervisor unit tests.

Note: By default, the collection is called according to pattern L_∗ (previously C_∗) when using the metadata generation tool. It is not recommended to keep this style of collection name because it is difficult and makes the code less readable. It is recommended to rename a collection by giving it a clear and explicit name that does not conflict with other properties.

Naming rules for classes and representations

These rules must be applied in addition to the naming rules for dictionary elements. They are applicable for standard development.

Persistent classes

Other classes

Classes names cannot be the same as the name or the abbreviation of an existing table if they are not linked to it. No class name can be the same as one that already exists in the dictionary table.

Naming rules for methods

Note: Public methods can be used by any developer using a class delivered in the standard. Private methods are defined for internal use of the class implementation.

Private methods need to be prefixed with an underscore, followed with a character corresponding to the naming rules previously defined. For example:

The private methods are not documented and are subject to changes without notice. It is recommended to implement the corresponding code in a separate script (not supplied in the source) to avoid their use by developers that do not follow the rules.

Numbering rules for elements identified by a number

MISCELLANEOUS TABLES
RangeUse
1000-1999Vertical developments
4000-4999Add-ons
6000-6999Specific developments
8000-8999Localizations
13000-13999Add-ons
18000-29999Add-ons
LOCAL MENUS
RangeUse
160-164Messages for specific developments
165-169Messages for vertical developments
1000-1999Local menus for vertical developments
4000-4999Add-ons
5100-5199Messages for vertical developments
5100-5199Local menus for vertical developments
5200-5999Local menus for vertical developments
6000-6199Messages for specific developments
6200-6999Local menus for specific developments
8000-8999Localizations
13000-13999Add-ons
18000-29999Add-ons

Suggestions

Scripts organization

There are no strict recommendations for script organization, except for the following rules.

Library script

A script storing a library of functions must follow the naming rules previously defined.

Caution: Do not add version 7 native functions in scripts containing version 6 code.

Normalization of functions called in a library

Try to avoid the use of subprog when creating functions in libraries. Use funprog instead to simplify error handling.

No error class can handle the error in a simple way in the case where this is not relevant. In this case, the normalization is:

Scripts associated with classes

By default, scripts associated with a class have names in four segments, with an underscore between the second and third segments. The format of the name is AB_CD, where:

Example: A vertical developer using prefix "XVE" for all his dictionary elements has a vertical script associated to standard class "BPCUSTOMER". The recommended script name would be:

Splitting scripts

It can be useful to split scripts into several subscripts, either because the script would be too large, or simply for a better code organization. In this case, each subscript name should consist in five segments, with format AB_CD_E:

Example: Main script "BPCUSTOMER_CSTD" will call its subscripts as follows:

Caution: These subscripts are called from the main script which acts as a router. They do not have to be defined as class scripts in the class dictionnary.

"BPCUSTOMER_CSTD_TYP" and "BPCUSTOMER_CSTD_GAT" are not called from "BPCUSTOMER_CSTD". "BPCUSTOMER_CSTD_TYP" is linked to the data type in the data type dictionnary, and "BPCUSTOMER_CSTD_GAT" is called by the remote call API.

Example of what could be the "BPCUSTOMER_CSTD" routing:

 $EVENTGosub EVENT From BPCUSTOMER_CSTD_EVTReturn$PROPERTIESGosub PROPERTIES From BPCUSTOMER_CSTD_PROReturn$METHODSIf (left$([L]AMETHOD,1) = "_")Gosub METHODS From BPCUSTOMER_CSTD_MPRElseGosub METHODS From BPCUSTOMER_CSTD_MPUEndifReturn$OPERATIONSIf (left$([L]AOPERATION,1) = "_")Gosub OPERATIONS From BPCUSTOMER_CSTD_MPRElseGosub OPERATIONS From BPCUSTOMER_CSTD_MPUEndifReturn

Naming rules for collections

A collection is a property like any other. We strongly recommended not to use prefixes such as "C_" for several reasons:

However, naming frequent collections can be useful. For example, you can have a standard short name for addresses or cost accounting segments, such as "IADD" (invoice addresses), "OADD" (order addresses), or "CCE" (cost accounting).

Naming rules for menu items

The menu items associated to "classic" pages have to follow the rule given by the menu profile naming tool. The other menu items follow the same naming rules as the other dictionary elements.