Welcome to the AL Extension Template for EB Development. This repository contains the foundational structure and coding standards required for developing AL language extensions for Business Central.
This template is designed to provide a standardized structure for AL extensions developed within EB Development. By following the guidelines and configurations provided here, we ensure consistency, readability, maintainability, and compliance with best practices across all projects.
- PascalCase: All identifiers (e.g., object names, procedure names, variable names) should use PascalCase.
- Abbreviations: Avoid abbreviations unless they are widely recognized.
- Prefixes: Use appropriate prefixes for variables to clarify their scope or type.
- Extensions of Existing Objects: Object names should be based on the original object with a "PTE" suffix.
- Example:
Sales Header PTE
- Example:
- New Objects: For new objects, the name should include the "PTE" suffix and clearly describe the object's purpose.
- Example:
Customer Ledger PTE
- Example:
- Use descriptive verbs or verb phrases.
- Example:
CalculateTotalAmount()
,GetCustomerDetails()
- Example:
- Use names that clearly convey the purpose of the variable.
- Example:
SalesOrderHeader
,CustomerBalance
- Example:
- Use
OnBefore
andOnAfter
prefixes for event publishers.- Example:
OnBeforeCalculateTotals
,OnAfterPostInvoice
- Example:
- Lowercase and Singular: All folders should be lowercase and singular.
- Example:
/table/
/page/
/codeunit/
/report/
/enum/
- Example:
- Naming Pattern: File names should follow the pattern
<ObjectNameShort>.<ObjectTypeShortPascalCase>.al
.- Example:
SalesHeader.Page.al
- Example:
- Source Files: All source files should be placed in the root
src/
folder within the extension folder.
- Git: All AL files should be placed under source control using Git. The repository structure should reflect the file structure guidelines provided above.
This template includes strict rules and configurations to enforce best practices in AL development. The settings.json
and ruleset.json
files containing the necessary Code Cop configurations can be found in this repository.
- Code Cop Configurations: Refer to the
settings.json
andruleset.json
files for the configurations used in this template.
These configurations ensure that the code adheres to EB Development’s strict standards for variable naming, object naming, code structure, and more.
When contributing to this repository, please follow the naming conventions, file structure, and code standards as outlined above. Adherence to these guidelines is critical for maintaining consistency across all projects.