Syntax and snippets

Note

We're working to improve the onboarding experience for AL developers. If you have feedback about this article, use the Feedback section at the bottom of the article to tell us what you'd like to see.

We also welcome contributions to our documentation. Learn more about contributing in Contribute to the help.

The syntax of the AL language is designed to help building business applications for Business Central.

Tip


Use Ctrl+Space to trigger IntelliSense and get assistance on code completion, parameter info, quick info, and member lists. For more information about snippets, see Syntax and snippets.

In addition to the inline help of IntelliSense, you have access to various snippets that give you a template for a specific object type. Use a code snippet from an .al file by start typing the snippet name. All snippets start with the letter t. For example, to get a template for a table, type ttable and press Tab.

Examples of snippets

The following list is a noncomprehensive list of the snippets that you can use in the AL.

Type...To get a...
tactionAction structure
tassertAssert error structure
tcaseofCase of structure
tcaseelseCase else structure
tcodeunitCodeunit object structure
tcontroladdinControl add-in structure
tenumEnum structure
tenumextEnum extension structure
tfieldTable field structure
tfieldpagePage field structure
tforFor structure
tifIf structure
tifelseIf else structure
tpagePage object structure. Choose between Card, List, API, RoleCenter, or PromptDialog type.
tpageextPage extension structure
tprocedureMethod structure
tqueryQuery object structure
trepeatRepeat until structure
treportReport object structure
ttableTable object structure
ttableextTable extension structure
ttriggerTrigger structure
twithdoWith do structure
twhileWhile structure
txmlportXMLport object structure

Get started with AL
Developing extensions in AL