alguidelines/content/docs/BestPractices/line-start-keywords/index.md
Henrik Helgesen fb17dc9640 Removed Discussion Links. Using new Theme solution.
Some additional MDLint cleanup as well
2022-02-24 15:36:06 -08:00

31 lines
700 B
Markdown

---
title: "Line Start Keywords"
tags: ["AL","Readability"]
categories: ["Best Practice"]
---
_Created by Microsoft, Described by waldo_
## Description
The `end`, `if`, `repeat`, `for`, `while`, `else` and `case` statement should always start a line.
## Bad code
```al
if IsContactName then ValidateContactName()
else if IsSalespersonCode then ValidateSalespersonCode()
else if IsSalesCycleCode then ValidatSalesCycleCode();
```
## Good code
```al
if IsContactName then
ValidateContactName()
else
if IsSalespersonCode then
ValidateSalespersonCode()
else
if IsSalesCycleCode then
ValidatSalesCycleCode();
```