Added tags & categories + cleanup

This commit is contained in:
waldo1001 2022-02-24 14:45:35 +01:00
parent 4515a721bd
commit 5ee0436639
161 changed files with 295 additions and 34 deletions

View file

@ -2,6 +2,7 @@
chapter = true
title = "2. Anti-Patterns"
weight = 130
tags = ["C/AL"]
+++
Some of the software development practices, had **not** stood the test of time. Despite that, some are still being used today by developers everywhere.

View file

@ -1,6 +1,7 @@
+++
title = "Nav Upgrade"
weight = 840
tags = ["C/AL"]
+++
## Anti-Patterns in NAV Upgrade

View file

@ -1,6 +1,7 @@
+++
title = "Reusable Bugs"
weight = 1020
tags = ["C/AL"]
+++
_By Bogdana Botez, Andreas Moth, Eric Wauters (waldo), Elly Nkya, Nikola Kukrika_

View file

@ -2,6 +2,8 @@
chapter = true
title = "3. CAL Coding Guidelines"
weight = 150
tags = ["C/AL"]
categories = ["Best Practice"]
+++
We've decided to publish our current C/AL coding guidelines. They are actual, as per January 2015 when this is published (but might fall out of sync as time goes by).

View file

@ -1,6 +1,8 @@
+++
title = "Design"
weight = 490
tags = ["C/AL"]
categories = ["Best Practice"]
+++
## C/AL Coding Guidelines

View file

@ -1,6 +1,8 @@
+++
title = "By Reference Parameters"
weight = 280
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Do not declare parameters by reference if their values are not intended to be changed.

View file

@ -1,6 +1,8 @@
+++
title = "Class Coupling"
weight = 320
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Do not write functions that have high class coupling. This makes the code hard to maintain.

View file

@ -1,6 +1,8 @@
+++
title = "Cyclomatic Complexity"
weight = 460
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Do not write functions that have high cyclomatic complexity. This makes the code hard to maintain.

View file

@ -1,5 +1,7 @@
+++
title = "Encapsulate Local Functionality"
weight = 530
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Any function used local must be defined as local.

View file

@ -1,6 +1,8 @@
+++
title = "FINDSET FINDFIRST FINDLAST"
weight = 600
tags = ["C/AL"]
categories = ["Best Practice"]
+++
FINDSET, FIND('+') or FIND('-') should only be used when NEXT is used and vice versa.

View file

@ -1,6 +1,8 @@
+++
title = "Initialized Variables"
weight = 660
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Variables should always be set to a specific value, before they are used.

View file

@ -1,6 +1,8 @@
+++
title = "Maintainability Index"
weight = 770
tags = ["C/AL"]
categories = ["Best Practice"]
+++
[Maintainability Index][anchor0]: Do not write functions that have a very low maintainability index. This makes the code hard to maintain.

View file

@ -1,6 +1,8 @@
+++
title = "Parameter Placeholders"
weight = 920
tags = ["C/AL"]
categories = ["Best Practice"]
+++
The number of parameters passed to a string must match the placeholders.

View file

@ -1,6 +1,8 @@
+++
title = "Static Object Invocation"
weight = 1160
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Call objects statically whenever possible. It reduces extra noise and removes extra variables. Downside: changing the name of the object which is called statically will need a code update.

View file

@ -1,6 +1,8 @@
+++
title = "Unreachable Code"
weight = 1310
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Do not write code that will never be hit.

View file

@ -1,6 +1,8 @@
+++
title = "Unused Initialized Variables"
weight = 1320
tags = ["C/AL"]
categories = ["Best Practice"]
+++
The value assigned to a variable must be used. Else the variable is not necessary.

View file

@ -1,6 +1,8 @@
+++
title = "Unused Variables"
weight = 1330
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Do not declare variables that are unused.

View file

@ -1,6 +1,8 @@
+++
title = "Variable Capacity Mismatch"
weight = 1410
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Do not assign a value to a variable whose capacity is smaller.

View file

@ -1,6 +1,8 @@
+++
title = "WITH Scope Name Collision"
weight = 1450
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Do not use the WITH scope when it has a variable whose name is the same as a local variable. This can lead to wrong code assumptions.

View file

@ -1,6 +1,8 @@
+++
title = "Internally used DotNet Types"
weight = 690
tags = ["C/AL"]
categories = ["Best Practice"]
+++
_(Dynamics NAV 2015)_

View file

@ -1,6 +1,8 @@
+++
title = "Internationalization"
weight = 700
tags = ["C/AL"]
categories = ["Best Practice"]
+++
## C/AL Coding Guidelines

View file

@ -1,6 +1,8 @@
+++
title = "Using Calcdate"
weight = 1370
tags = ["C/AL"]
categories = ["Best Practice"]
+++
CALCDATE should only be used with DateFormula variables. Alternatively the string should be enclosed using the <> symbols.

View file

@ -1,6 +1,8 @@
+++
title = "Localizability"
weight = 750
tags = ["C/AL"]
categories = ["Best Practice"]
+++
## C/AL Coding Guidelines

View file

@ -1,6 +1,8 @@
+++
title = "CaptionML on System Pages"
weight = 300
tags = ["C/AL"]
categories = ["Best Practice"]
+++
CaptionML should always be specified on a page field for a system table. By default, system tables do not have captions, so if you need to use them in the UI then captions need to be added.

View file

@ -1,6 +1,8 @@
+++
title = "FIELDCAPTION and TABLECAPTION"
weight = 580
tags = ["C/AL"]
categories = ["Best Practice"]
+++
For user messages, errors etc., use FIELDCAPTION not FIELDNAME and TABLECAPTION not TABLENAME.

View file

@ -1,6 +1,8 @@
+++
title = "Global Text Constants"
weight = 610
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Declare Text Constant as global variables.

View file

@ -1,6 +1,8 @@
+++
title = "Use Text Constants"
weight = 1360
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Pass user messages using Text Constants. It makes translation easy.

View file

@ -1,6 +1,8 @@
+++
title = "Using OptionCaptionML"
weight = 1380
tags = ["C/AL"]
categories = ["Best Practice"]
+++
The OptionCaptionML should be filled in for sourceexpression using option data types.

View file

@ -1,6 +1,8 @@
+++
title = "Readability"
weight = 980
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
## C/AL Coding Guidelines

View file

@ -1,6 +1,8 @@
+++
title = "Begin as an 'After Word'"
weight = 230
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
When BEGIN follows THEN, ELSE, DO, it should be on the same line, preceded by one space character.

View file

@ -1,6 +1,8 @@
+++
title = "Begin-End - Compound Only"
weight = 240
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
Only use BEGIN..END to enclose compound statements.

View file

@ -1,6 +1,8 @@
+++
title = "Binary Operator to Start Line"
weight = 250
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
Do not start a line with a binary operator.

View file

@ -1,6 +1,8 @@
+++
title = "Blank Lines"
weight = 260
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
Do not use blank lines at the beginning or end of any functions, after BEGIN, before END, or inside multiline expressions.

View file

@ -1,6 +1,8 @@
+++
title = "CASE Action"
weight = 310
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
A CASE action should start on a line after the possibility.

View file

@ -1,6 +1,8 @@
+++
title = "Colon usage in CASE"
weight = 340
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
The last possibility on a CASE statement must be immediately followed by a colon.

View file

@ -1,6 +1,8 @@
+++
title = "Comments inside Curly Brackets"
weight = 350
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
Never use curly bracket comments. During development, the "Block comment" functionality can be used instead. However, in production code, block comments are not recommended.

View file

@ -1,6 +1,8 @@
+++
title = "Comment Spacing"
weight = 360
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
Always start comments with // followed by one space character.

View file

@ -1,6 +1,8 @@
+++
title = "END ELSE Pair"
weight = 540
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
The END ELSE pair should always appear on the same line.

View file

@ -1,6 +1,8 @@
+++
title = "Indentation"
weight = 650
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
In general, use an indentation of two space characters. Logical expressions in the IF, WHILE, and UNTIL parts are indented at least 3, 6, and 6 spaces respectively.

View file

@ -1,6 +1,8 @@
+++
title = "Keyword Pairs - Indentation"
weight = 730
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
The IF..THEN pair, WHILE..DO pair, and FOR..DO pair must appear on the same line or the same level of indentation.

View file

@ -1,6 +1,8 @@
+++
title = "Line Start Keywords"
weight = 740
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
The END, IF, REPEAT, FOR, WHILE, ELSE and CASE statement should always start a line.

View file

@ -1,6 +1,8 @@
+++
title = "Lonely Repeat"
weight = 760
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
The REPEAT statement should always be alone on a line.

View file

@ -1,6 +1,8 @@
+++
title = "Named Invocations"
weight = 830
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
When calling an object statically use the name, not the number

View file

@ -1,6 +1,8 @@
+++
title = "Nested WITHs"
weight = 850
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
Do not nest WITHs that reference different types of objects.

View file

@ -1,6 +1,8 @@
+++
title = "One Statement Per Line"
weight = 910
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
A line of code should not have more than one statement.

View file

@ -1,6 +1,8 @@
+++
title = "Separate IF and ELSE"
weight = 1050
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
IF and ELSE statements should be on separate lines.

View file

@ -1,6 +1,8 @@
+++
title = "Spacing Binary Operators"
weight = 1120
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
There must be exactly one space character on each side of a binary operator such as = + - AND OR =. The parameter comma operator however, should have no spaces.

View file

@ -1,6 +1,8 @@
+++
title = "Spacing Brackets and ::"
weight = 1130
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
There must be no spaces characters before and after [] dimension brackets symbols or :: option symbols.

View file

@ -1,6 +1,8 @@
+++
title = "Spacing Unary Operators"
weight = 1140
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
There must be no space between a unary operator and its argument (except for the NOT keyword).

View file

@ -1,6 +1,8 @@
+++
title = "Suggested Abbreviations"
weight = 1170
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
### Suggested Abbreviations

View file

@ -1,6 +1,8 @@
+++
title = "Temporary Variable Naming"
weight = 1200
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
The name of a temporary variable must be prefixed with the word Temp and not otherwise.

View file

@ -1,6 +1,8 @@
+++
title = "TextConst Suffixes"
weight = 1210
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
TextConst variable names should have a suffix (an approved three-letter suffix: Msg, Tok, Err, Qst, Lbl, Txt) describing usage.

View file

@ -1,6 +1,8 @@
+++
title = "Unary Operator Line End"
weight = 1250
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
Do not end a line with unary operator.

View file

@ -1,6 +1,8 @@
+++
title = "Unnecessary Compound Parenthesis"
weight = 1260
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
Use parenthesis only to enclose compound expressions inside compound expressions.

View file

@ -1,6 +1,8 @@
+++
title = "Unnecessary ELSE"
weight = 1270
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
ELSE should not be used when the last action in the THEN part is an EXIT, BREAK, SKIP, QUIT, ERROR.

View file

@ -1,6 +1,8 @@
+++
title = "Unnecessary Function Parenthesis"
weight = 1280
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
Do not use parenthesis in a function call if the function does not have any parameters.

View file

@ -1,6 +1,8 @@
+++
title = "Unnecessary Separators"
weight = 1290
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
There should be no unnecessary separators.

View file

@ -1,6 +1,8 @@
+++
title = "Unnecessary TRUE/FALSE"
weight = 1300
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
Do not use TRUE or FALSE keywords unnecessarily if the expression is already an logical expression.

View file

@ -1,6 +1,8 @@
+++
title = "Variable Already Scoped"
weight = 1400
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
Do not use scope ''.'' qualifier unnecessarily when a variable is already implicitly or explicitly scoped. It keeps the code simpler.

View file

@ -1,6 +1,8 @@
+++
title = "Variable Naming"
weight = 1420
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
Variables that refer to a C/AL object must contain the objects name, abbreviated where necessary.

View file

@ -1,6 +1,8 @@
+++
title = "Variables Declarations Order"
weight = 1430
tags = ["C/AL","Readability"]
categories = ["Best Practice"]
+++
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 the same as the object list in the object designer for C/AL objects. Afterwards come the complex variables like RecordRef, .NET, FieldRef etc. At the end come all the simple data types in no particular order.

View file

@ -1,6 +1,8 @@
+++
title = "UX"
weight = 1390
tags = ["C/AL"]
categories = ["Best Practice"]
+++
## C/AL Coding Guidelines

View file

@ -1,6 +1,8 @@
+++
title = "Actions - Images"
weight = 200
tags = ["C/AL"]
categories = ["Best Practice"]
+++
All actions must have an image assigned to them.

View file

@ -1,6 +1,8 @@
+++
title = "CONFIRM"
weight = 380
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Always end CONFIRM with a question mark.

View file

@ -1,6 +1,8 @@
+++
title = "FIELDERROR"
weight = 590
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Never use FIELDERROR with a period as it is automatically inserted.

View file

@ -1,6 +1,8 @@
+++
title = "MESSAGE and ERROR"
weight = 790
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Always end MESSAGE or ERROR with a period.

View file

@ -2,6 +2,7 @@
chapter = true
title = "(OLD) Get Involved"
weight = 170
tags = ["C/AL"]
+++
**Reminder, this is an ARCHIVE of the Patterns site, this information is not current.**

View file

@ -1,6 +1,7 @@
+++
title = "Code of Conduct"
weight = 330
tags = ["C/AL"]
+++
Find below the rules to be used when disseminating or relating to the NAV Design Patterns.

View file

@ -1,6 +1,7 @@
+++
title = "Patterns Authors"
weight = 930
tags = ["C/AL"]
+++
This is the list of people that have been part of the NAV Design Patterns team. If you would like to join the project follow the instructions provided on [Be a NAV Pattern Author][anchor0] page.

View file

@ -1,6 +1,7 @@
+++
title = "Template for writing Nav Design Patterns"
weight = 1180
tags = ["C/AL"]
+++
This is a guideline, some parts are optional (if there's no content, remove the whole paragraph).

View file

@ -1,6 +1,7 @@
+++
title = "NAV Patterns Archive"
weight = 20
tags = ["C/AL"]
+++
## About the archive

View file

@ -1,8 +1,8 @@
---
title: "Patterns"
title: "1. Patterns"
weight: 110
tags: ["NAV", "C/AL"]
categories: ["Archived Pattern"]
tags: ["C/AL"]
categories: ["Pattern"]
description: >
Patterns described to be used with Microsoft Dynamics NAV
---

View file

@ -1,6 +1,8 @@
+++
title = "Activity Logs"
weight = 210
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Originally by Ciprian Iordache at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Argument Table"
weight = 220
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Originally By Nikola Kukrika and waldo_

View file

@ -1,6 +1,8 @@
+++
title = "Blocked Entity"
weight = 270
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Originally by Abhishek Ghosh at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Data Driven Blocked Entity"
weight = 470
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Written by Bogdan Andrei Sturzoiu, at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Cached Web Server Calls"
weight = 290
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Originally by Mostafa Balat, Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Conditional Cascading Update"
weight = 370
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Originally by Jan Hoek at IDYN_

View file

@ -1,6 +1,8 @@
+++
title = "Copy Document"
weight = 390
tags = ["C/AL"]
categories = ["Pattern"]
+++
_By Bogdan Sturzoiu at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Create Data from Templates"
weight = 400
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Originally by Nikola Kukrika at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Create URLs to NAV Clients"
weight = 410
tags = ["C/AL"]
categories = ["Pattern"]
+++
_By Mike Borg Cardona and Bogdana Botez at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Creating Custom Charts"
weight = 420
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Originally by Nikola Kukrika at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Cross Session Events"
weight = 430
tags = ["C/AL"]
categories = ["Pattern"]
+++
_By Nikolai L'Estrange, from TVision Technology Ltd. in the UK_

View file

@ -1,6 +1,8 @@
+++
title = "Currently Active Record"
weight = 450
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Authors: Henrik Langbak and Kim Ginnerup, Bording Data_

View file

@ -1,6 +1,8 @@
+++
title = "Data Migration Façade"
weight = 480
tags = ["C/AL"]
categories = ["Pattern"]
+++
_By David Bastide and Soumya Dutta at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Discovery Event"
weight = 500
tags = ["C/AL"]
categories = ["Pattern"]
+++
_by waldo_

View file

@ -1,6 +1,8 @@
+++
title = "Document"
weight = 510
tags = ["C/AL"]
categories = ["Pattern"]
+++
_By Xavier Garonnat, knk Ingénierie (France), xgaronnat@knk.fr_

View file

@ -1,6 +1,8 @@
+++
title = "Easy Update Of Setup Or Supplementary Information"
weight = 520
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Originally by Anders Larsen at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Error Message Processing"
weight = 550
tags = ["C/AL"]
categories = ["Pattern"]
+++
_By Jesper Schulz at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Extending the Role Center Headlines"
weight = 560
tags = ["C/AL"]
categories = ["Pattern"]
+++
_By David Bastide at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Feature Localization For Data Structures"
weight = 570
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Originally by Bogdan Sturzoiu at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Hooks"
weight = 620
tags = ["C/AL"]
categories = ["Pattern"]
+++
_By Eric Wauters ([waldo][anchor0]), Partner-Ready-Software_

View file

@ -1,6 +1,8 @@
+++
title = "Surrogate keys using Autoincrement Pattern"
weight = 630
tags = ["C/AL"]
categories = ["Pattern"]
+++
_By [Soren Klemmensen][anchor0], [_Partner-Ready-Software_ ][anchor1] & [360 Visibility][anchor2]_

View file

@ -1,6 +1,8 @@
+++
title = "Instructions in the UI"
weight = 670
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Originally by Nikola Kukrika at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Integration of Addresses"
weight = 680
tags = ["C/AL"]
categories = ["Pattern"]
+++
{{< youtube 60Wrx9N-gfY>}}

View file

@ -1,6 +1,8 @@
+++
title = "Journal Error Processing"
weight = 710
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Originally by Bogdana Botez at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Journal Template Batch Line"
weight = 720
tags = ["C/AL"]
categories = ["Pattern"]
+++
_Originally by Bogdana Botez at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Master Data"
weight = 780
tags = ["C/AL"]
categories = ["Pattern"]
+++
_By [Soren Klemmensen][anchor0], [_Partner-Ready-Software_ ][anchor1] & [360 Visibility][anchor2]_

View file

@ -1,6 +1,8 @@
+++
title = "Multi-file Download"
weight = 800
tags = ["C/AL"]
categories = ["Pattern"]
+++
_By Martin Dam at Microsoft Development Center Copenhagen_

View file

@ -1,6 +1,8 @@
+++
title = "Multi-Page List"
weight = 810
tags = ["C/AL"]
categories = ["Pattern"]
+++
_By Bogdana Botez at Microsoft Development Center Copenhagen_

Some files were not shown because too many files have changed in this diff Show more