deploy: 2d3e5d02a2
This commit is contained in:
parent
27483c8f45
commit
740dbf4e5a
149 changed files with 3229 additions and 2860 deletions
|
|
@ -1,63 +1,63 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Readability on BC AL Help</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/</link><description>Recent content in Readability on BC AL Help</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><atom:link href="https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/index.xml" rel="self" type="application/rss+xml"/><item><title>Begin as an 'After Word'</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/begin-as-an-afterword/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/begin-as-an-afterword/</guid><description>When BEGIN follows THEN, ELSE, DO, it should be on the same line, preceded by one space character. Bad code
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Readability on AL Guidelines</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/</link><description>Recent content in Readability on AL Guidelines</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><atom:link href="https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/index.xml" rel="self" type="application/rss+xml"/><item><title>Begin as an 'After Word'</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/begin-as-an-afterword/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/begin-as-an-afterword/</guid><description>When BEGIN follows THEN, ELSE, DO, it should be on the same line, preceded by one space character. Bad code
|
||||
IF ICPartnerRefType = ICPartnerRefType::&quot;Common Item No.&quot; THEN BEGIN ... END; Good code
|
||||
IF ICPartnerRefType = ICPartnerRefType::&quot;Common Item No.&quot; THEN BEGIN ... END;</description></item><item><title>Begin-End - Compound Only</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/begin-end/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/begin-end/</guid><description>Only use BEGIN..END to enclose compound statements. Bad code
|
||||
IF ICPartnerRefType = ICPartnerRefType::&quot;Common Item No.&quot; THEN BEGIN ... END;</description></item><item><title>Begin-End - Compound Only</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/begin-end/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/begin-end/</guid><description>Only use BEGIN..END to enclose compound statements. Bad code
|
||||
IF FINDSET THEN BEGIN REPEAT ... UNTIL NEXT = 0; END; Good code
|
||||
IF FINDSET THEN REPEAT ... UNTIL NEXT = 0; Bad code
|
||||
IF IsAssemblyOutputLine THEN BEGIN TESTFIELD(&quot;Order Line No.&quot;,0); END; Good code
|
||||
IF IsAssemblyOutputLine THEN TESTFIELD(&quot;Order Line No.&quot;,0); Bad code
|
||||
IF FINDSET THEN REPEAT BEGIN ... END; UNTIL NEXT = 0; Good code
|
||||
IF FINDSET THEN REPEAT .</description></item><item><title>Binary Operator to Start Line</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/binary-operator-line-start/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/binary-operator-line-start/</guid><description>Do not start a line with a binary operator. Bad code
|
||||
IF FINDSET THEN REPEAT .</description></item><item><title>Binary Operator to Start Line</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/binary-operator-line-start/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/binary-operator-line-start/</guid><description>Do not start a line with a binary operator. Bad code
|
||||
&quot;Quantity to Ship&quot; := Quantity - &quot;Quantity Shipped&quot; Good code
|
||||
&quot;Quantity to Ship&quot; := Quantity - &quot;Quantity Shipped&quot;</description></item><item><title>Blank Lines.md</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/blank-lines/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/blank-lines/</guid><description>Do not use blank lines at the beginning or end of any functions, after BEGIN, before END, or inside multiline expressions. Bad code
|
||||
&quot;Quantity to Ship&quot; := Quantity - &quot;Quantity Shipped&quot;</description></item><item><title>Blank Lines.md</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/blank-lines/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/blank-lines/</guid><description>Do not use blank lines at the beginning or end of any functions, after BEGIN, before END, or inside multiline expressions. Bad code
|
||||
PROCEDURE MATRIX\_OnDrillDown@1133(MATRIX\_ColumnOrdinal : Integer); BEGIN SetupDrillDownCol(MATRIX\_ColumnOrdinal); DrillDown(FALSE,ValueType); END; Good code
|
||||
PROCEDURE MATRIX\_OnDrillDown@1133(MATRIX\_ColumnOrdinal : Integer); BEGIN SetupDrillDownCol(MATRIX\_ColumnOrdinal); DrillDown(FALSE,ValueType); END; Bad code
|
||||
IF NameIsValid AND Name2IsValid THEN Good code
|
||||
IF NameIsValid AND Name2IsValid THEN</description></item><item><title>CASE Action</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/case-actions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/case-actions/</guid><description>A CASE action should start on a line after the possibility. Bad code
|
||||
IF NameIsValid AND Name2IsValid THEN</description></item><item><title>CASE Action</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/case-actions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/case-actions/</guid><description>A CASE action should start on a line after the possibility. Bad code
|
||||
CASE Letter OF 'A': Letter2 := '10'; 'B': Letter2 := '11'; Good code
|
||||
CASE Letter OF 'A': Letter2 := '10'; 'B': Letter2 := '11';</description></item><item><title>Colon usage in CASE</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/colon-usage-in-case/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/colon-usage-in-case/</guid><description>The last possibility on a CASE statement must be immediately followed by a colon. Bad code
|
||||
CASE Letter OF 'A': Letter2 := '10'; 'B': Letter2 := '11';</description></item><item><title>Colon usage in CASE</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/colon-usage-in-case/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/colon-usage-in-case/</guid><description>The last possibility on a CASE statement must be immediately followed by a colon. Bad code
|
||||
CASE DimOption OF DimOption::&quot;Global Dimension 1&quot; : DimValue.&quot;Dimension Code&quot; := GLSetup.&quot;Global Dimension 1 Code&quot;; Good code
|
||||
CASE DimOption OF DimOption::&quot;Global Dimension 1&quot;: DimValue.&quot;Dimension Code&quot; := GLSetup.&quot;Global Dimension 1 Code&quot;;</description></item><item><title>Comments inside Curly Brackets</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/comments-curly-brackets/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/comments-curly-brackets/</guid><description>Never use curly bracket comments. During development, the &ldquo;Block comment&rdquo; functionality can be used instead. However, in production code, block comments are not recommended. Bad code
|
||||
CASE DimOption OF DimOption::&quot;Global Dimension 1&quot;: DimValue.&quot;Dimension Code&quot; := GLSetup.&quot;Global Dimension 1 Code&quot;;</description></item><item><title>Comments inside Curly Brackets</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/comments-curly-brackets/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/comments-curly-brackets/</guid><description>Never use curly bracket comments. During development, the &ldquo;Block comment&rdquo; functionality can be used instead. However, in production code, block comments are not recommended. Bad code
|
||||
PeriodTxt: {Period} Good code
|
||||
PeriodTxt: // Period Bad code
|
||||
PROCEDURE MATRIX\_OnAfterGetRecord@10(MATRIX\_ColumnOrdinal : Integer); BEGIN { IF ShowColumnName THEN MatrixHeader := MatrixRecords\[MATRIX\_ColumnOrdinal\].Name ELSE MatrixHeader := MatrixRecords\[MATRIX\_ColumnOrdinal\].Code; } MatrixRecord := MatrixRecords\[MATRIX\_ColumnOrdinal\]; AnalysisValue := CalcAmt(ValueType,TRUE); MATRIX\_CellData\[MATRIX\_ColumnOrdinal\] := AnalysisValue; END; Good code
|
||||
PROCEDURE MATRIX\_OnAfterGetRecord@10(MATRIX\_ColumnOrdinal : Integer); BEGIN MatrixRecord := MatrixRecords\[MATRIX\_ColumnOrdinal\]; AnalysisValue := CalcAmt(ValueType,TRUE); MATRIX\_CellData\[MATRIX\_ColumnOrdinal\] := AnalysisValue; END;</description></item><item><title>Comment Spacing</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/comments-spacing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/comments-spacing/</guid><description>Always start comments with // followed by one space character. Bad code
|
||||
PROCEDURE MATRIX\_OnAfterGetRecord@10(MATRIX\_ColumnOrdinal : Integer); BEGIN MatrixRecord := MatrixRecords\[MATRIX\_ColumnOrdinal\]; AnalysisValue := CalcAmt(ValueType,TRUE); MATRIX\_CellData\[MATRIX\_ColumnOrdinal\] := AnalysisValue; END;</description></item><item><title>Comment Spacing</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/comments-spacing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/comments-spacing/</guid><description>Always start comments with // followed by one space character. Bad code
|
||||
RowNo += 1000; //Move way below the budget Good code
|
||||
RowNo += 1000; // Move way below the budget</description></item><item><title>END ELSE Pair</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/end-else-pair/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/end-else-pair/</guid><description>The END ELSE pair should always appear on the same line. Bad code
|
||||
RowNo += 1000; // Move way below the budget</description></item><item><title>END ELSE Pair</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/end-else-pair/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/end-else-pair/</guid><description>The END ELSE pair should always appear on the same line. Bad code
|
||||
IF OppEntry.FIND('-') THEN IF SalesCycleStage.FIND('-') THEN BEGIN ... END ELSE ... Good code
|
||||
IF OppEntry.FIND('-') THEN IF SalesCycleStage.FIND('-') THEN BEGIN ... END ELSE ...</description></item><item><title>Indentation</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/indentation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/indentation/</guid><description>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. Bad code
|
||||
IF OppEntry.FIND('-') THEN IF SalesCycleStage.FIND('-') THEN BEGIN ... END ELSE ...</description></item><item><title>Indentation</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/indentation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/indentation/</guid><description>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. Bad code
|
||||
IF GLSetup.&quot;Unrealized VAT&quot; OR (GLSetup.&quot;Prepayment Unrealized VAT&quot; AND NewCVLedgEntryBuf.Prepayment) Good code
|
||||
IF GLSetup.&quot;Unrealized VAT&quot; OR (GLSetup.&quot;Prepayment Unrealized VAT&quot; AND NewCVLedgEntryBuf.Prepayment) Bad code
|
||||
IF GenJnlLine.&quot;Account No.&quot; &lt;\&gt; ICPartner.Code THEN ICPartner.GET(&quot;Account No.&quot;); IF GenJnlLine.Amount \&gt; 0 THEN BEGIN ... Good code</description></item><item><title>Keyword Pairs - Indentation</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/keyword-pairs-indentation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/keyword-pairs-indentation/</guid><description>The IF..THEN pair, WHILE..DO pair, and FOR..DO pair must appear on the same line or the same level of indentation. Bad code
|
||||
IF GenJnlLine.&quot;Account No.&quot; &lt;\&gt; ICPartner.Code THEN ICPartner.GET(&quot;Account No.&quot;); IF GenJnlLine.Amount \&gt; 0 THEN BEGIN ... Good code</description></item><item><title>Keyword Pairs - Indentation</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/keyword-pairs-indentation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/keyword-pairs-indentation/</guid><description>The IF..THEN pair, WHILE..DO pair, and FOR..DO pair must appear on the same line or the same level of indentation. Bad code
|
||||
IF (x = y) AND (a = b) THEN Good code
|
||||
IF (x = y) AND (a = b) THEN</description></item><item><title>Line Start Keywords</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/line-start-keywords/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/line-start-keywords/</guid><description>The END, IF, REPEAT, FOR, WHILE, ELSE and CASE statement should always start a line. Bad code
|
||||
IF (x = y) AND (a = b) THEN</description></item><item><title>Line Start Keywords</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/line-start-keywords/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/line-start-keywords/</guid><description>The END, IF, REPEAT, FOR, WHILE, ELSE and CASE statement should always start a line. Bad code
|
||||
IF IsContactName THEN ValidateContactName ELSE IF IsSalespersonCode THEN ValidateSalespersonCode ELSE IF IsSalesCycleCode THEN ValidatSalesCycleCode; Good code
|
||||
IF IsContactName THEN ValidateContactName ELSE IF IsSalespersonCode THEN ValidateSalespersonCode ELSE IF IsSalesCycleCode THEN ValidatSalesCycleCode;</description></item><item><title>Lonely Repeat</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/lonely-repeat/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/lonely-repeat/</guid><description>The REPEAT statement should always be alone on a line. Bad code
|
||||
IF IsContactName THEN ValidateContactName ELSE IF IsSalespersonCode THEN ValidateSalespersonCode ELSE IF IsSalesCycleCode THEN ValidatSalesCycleCode;</description></item><item><title>Lonely Repeat</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/lonely-repeat/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/lonely-repeat/</guid><description>The REPEAT statement should always be alone on a line. Bad code
|
||||
IF ReservEntry.FINDSET THEN REPEAT Good code
|
||||
IF ReservEntry.FINDSET THEN REPEAT</description></item><item><title>Named Invocations</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/named-invocations/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/named-invocations/</guid><description>When calling an object statically use the name, not the number Bad code
|
||||
IF ReservEntry.FINDSET THEN REPEAT</description></item><item><title>Named Invocations</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/named-invocations/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/named-invocations/</guid><description>When calling an object statically use the name, not the number Bad code
|
||||
PAGE.RUNMODAL(525,SalesShptLine) Good code
|
||||
PAGE.RUNMODAL(PAGE::&quot;Posted Sales Shipment Lines&quot;,SalesShptLine)</description></item><item><title>Nested WITHs</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/nested-withs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/nested-withs/</guid><description>Do not nest WITHs that reference different types of objects. Bad code
|
||||
PAGE.RUNMODAL(PAGE::&quot;Posted Sales Shipment Lines&quot;,SalesShptLine)</description></item><item><title>Nested WITHs</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/nested-withs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/nested-withs/</guid><description>Do not nest WITHs that reference different types of objects. Bad code
|
||||
WITH PostedWhseShptLine DO BEGIN ... WITH ItemLedgEntry DO InsertBufferRec(...,&quot;Serial No.&quot;,&quot;Lot No.&quot;,...); ... END; Good code
|
||||
WITH PostedWhseShptLine DO BEGIN ... InsertBufferRec(...,ItemLedgEntry.&quot;Serial No.&quot;,ItemLedgEntry.&quot;Lot No.&quot;,...); ... END;</description></item><item><title>One Statement Per Line</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/one-statement-per-line/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/one-statement-per-line/</guid><description>A line of code should not have more than one statement. Bad code
|
||||
WITH PostedWhseShptLine DO BEGIN ... InsertBufferRec(...,ItemLedgEntry.&quot;Serial No.&quot;,ItemLedgEntry.&quot;Lot No.&quot;,...); ... END;</description></item><item><title>One Statement Per Line</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/one-statement-per-line/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/one-statement-per-line/</guid><description>A line of code should not have more than one statement. Bad code
|
||||
IF OppEntry.FIND('-') THEN EXIT Good code
|
||||
IF OppEntry.FIND('-') THEN EXIT Bad code
|
||||
TotalCost += Cost; TotalAmt += Amt; Good code
|
||||
TotalCost += Cost; TotalAmt += Amt;</description></item><item><title>Separate IF and ELSE</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/separate-if-and-else/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/separate-if-and-else/</guid><description>IF and ELSE statements should be on separate lines. Bad code
|
||||
TotalCost += Cost; TotalAmt += Amt;</description></item><item><title>Separate IF and ELSE</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/separate-if-and-else/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/separate-if-and-else/</guid><description>IF and ELSE statements should be on separate lines. Bad code
|
||||
IF Atom\[i+1\] = '\&gt;' THEN HasLogicalOperator := TRUE ELSE BEGIN ... END; Good code
|
||||
IF Atom\[i+1\] = '\&gt;' THEN HasLogicalOperator := TRUE ELSE BEGIN ... END;</description></item><item><title>Spacing Binary Operators</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/spacing-binary-operators/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/spacing-binary-operators/</guid><description>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. Bad code
|
||||
IF Atom\[i+1\] = '\&gt;' THEN HasLogicalOperator := TRUE ELSE BEGIN ... END;</description></item><item><title>Spacing Binary Operators</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/spacing-binary-operators/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/spacing-binary-operators/</guid><description>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. Bad code
|
||||
&quot;Line Discount %&quot; := &quot;Line Discount Amount&quot;/&quot;Line Value&quot;\*100 Good code
|
||||
&quot;Line Discount %&quot; := &quot;Line Discount Amount&quot; / &quot;Line Value&quot; \* 100; Bad code
|
||||
StartDate := CALCDATE('&lt;+'+FORMAT(Days + i)+'D\&gt;', StartDate); Good code
|
||||
StartDate := CALCDATE('&lt;+' + FORMAT(Days + i) + 'D\&gt;',StartDate); Bad code</description></item><item><title>Spacing Brackets and ::</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/spacing-brackets-and/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/spacing-brackets-and/</guid><description>There must be no spaces characters before and after [] dimension brackets symbols or :: option symbols. Bad code
|
||||
StartDate := CALCDATE('&lt;+' + FORMAT(Days + i) + 'D\&gt;',StartDate); Bad code</description></item><item><title>Spacing Brackets and ::</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/spacing-brackets-and/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/spacing-brackets-and/</guid><description>There must be no spaces characters before and after [] dimension brackets symbols or :: option symbols. Bad code
|
||||
A\[i\] \[j\] := Amt; Good code
|
||||
A\[i\]\[j\] := Amt; Bad code
|
||||
&quot;Currency Exchange Rate&quot;.&quot;Fix Exchange Rate Amount&quot; :: Currency: Good code
|
||||
&quot;Currency Exchange Rate&quot;.&quot;Fix Exchange Rate Amount&quot;::Currency: Bad code
|
||||
IF FIND (Which) THEN Good code
|
||||
IF FIND(Which) THEN</description></item><item><title>Spacing Unary Operators</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/spacing-unary-operators/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/spacing-unary-operators/</guid><description>There must be no space between a unary operator and its argument (except for the NOT keyword). Bad code
|
||||
IF FIND(Which) THEN</description></item><item><title>Spacing Unary Operators</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/spacing-unary-operators/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/spacing-unary-operators/</guid><description>There must be no space between a unary operator and its argument (except for the NOT keyword). Bad code
|
||||
IF NOT(Type = Type::Item) THEN Good code
|
||||
IF NOT (Type = Type::Item) THEN Bad code
|
||||
DiscAmt := - &quot;Discount Amount&quot;; Good code
|
||||
DiscAmt := -&quot;Discount Amount&quot;;</description></item><item><title>Suggested Abbreviations</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/suggested-abbreviations/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/suggested-abbreviations/</guid><description>Suggested Abbreviations Whenever possible, do not use abbreviations in variables, functions and objects names.
|
||||
DiscAmt := -&quot;Discount Amount&quot;;</description></item><item><title>Suggested Abbreviations</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/suggested-abbreviations/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/suggested-abbreviations/</guid><description>Suggested Abbreviations Whenever possible, do not use abbreviations in variables, functions and objects names.
|
||||
If there is no other choice, then use the suggestions below.
|
||||
Abbreviation
|
||||
Text
|
||||
|
|
@ -103,38 +103,38 @@ Appln
|
|||
application
|
||||
Arriv
|
||||
arrival
|
||||
Asm</description></item><item><title>Temporary Variable Naming</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/temporary-variable-naming/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/temporary-variable-naming/</guid><description>The name of a temporary variable must be prefixed with the word Temp and not otherwise. Bad code
|
||||
Asm</description></item><item><title>Temporary Variable Naming</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/temporary-variable-naming/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/temporary-variable-naming/</guid><description>The name of a temporary variable must be prefixed with the word Temp and not otherwise. Bad code
|
||||
JobWIPBuffer@1002 : TEMPORARY Record 1018; Good code
|
||||
TempJobWIPBuffer@1002 : TEMPORARY Record 1018; Bad code
|
||||
TempJobWIPBuffer@1002 : Record 1018; Good code
|
||||
CopyOfJobWIPBuffer@1002 : Record 1018;</description></item><item><title>TextConst Suffixes</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/textconst-suffixes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/textconst-suffixes/</guid><description>TextConst variable names should have a suffix (an approved three-letter suffix: Msg, Tok, Err, Qst, Lbl, Txt) describing usage. Bad code
|
||||
CopyOfJobWIPBuffer@1002 : Record 1018;</description></item><item><title>TextConst Suffixes</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/textconst-suffixes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/textconst-suffixes/</guid><description>TextConst variable names should have a suffix (an approved three-letter suffix: Msg, Tok, Err, Qst, Lbl, Txt) describing usage. Bad code
|
||||
CannotDeleteLine@1005 : TextConst 'ENU=You cannot delete this line because one or more rating values exists.'; ... ERROR(CannotDeleteLine,TABLECAPTION); Good code
|
||||
CannotDeleteLineErr@1005 : TextConst 'ENU=You cannot delete this line because one or more rating values exists.'; ... ERROR(CannotDeleteLineErr,TABLECAPTION); Bad code
|
||||
Text000@1011 : TextConst 'ENU=&quot;has been changed (initial a %1: %2= %3, %4= %5)&quot;'; .</description></item><item><title>Unary Operator Line End</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/unary-operator-line-end/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/unary-operator-line-end/</guid><description>Do not end a line with unary operator. Bad code
|
||||
Text000@1011 : TextConst 'ENU=&quot;has been changed (initial a %1: %2= %3, %4= %5)&quot;'; .</description></item><item><title>Unary Operator Line End</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/unary-operator-line-end/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/unary-operator-line-end/</guid><description>Do not end a line with unary operator. Bad code
|
||||
&quot;Quantity Handled (Base)&quot; := - &quot;Quantity Handled (Base)&quot;); Good code
|
||||
&quot;Quantity Handled (Base)&quot; := - &quot;Quantity Handled (Base)&quot;);</description></item><item><title>Unnecessary Compound Parenthesis</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-compound-parenthesis/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-compound-parenthesis/</guid><description>Use parenthesis only to enclose compound expressions inside compound expressions. Bad code
|
||||
&quot;Quantity Handled (Base)&quot; := - &quot;Quantity Handled (Base)&quot;);</description></item><item><title>Unnecessary Compound Parenthesis</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-compound-parenthesis/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-compound-parenthesis/</guid><description>Use parenthesis only to enclose compound expressions inside compound expressions. Bad code
|
||||
IF (&quot;Costing Method&quot; = &quot;Costing Method&quot;::Standard) THEN Good code
|
||||
IF &quot;Costing Method&quot; = &quot;Costing Method&quot;::Standard THEN Bad code
|
||||
ProfitPct = -(Profit) / CostAmt \* 100; Good code
|
||||
ProfitPct = -Profit / CostAmt \* 100;</description></item><item><title>Unnecessary ELSE</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-else/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-else/</guid><description>ELSE should not be used when the last action in the THEN part is an EXIT, BREAK, SKIP, QUIT, ERROR. Bad code
|
||||
ProfitPct = -Profit / CostAmt \* 100;</description></item><item><title>Unnecessary ELSE</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-else/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-else/</guid><description>ELSE should not be used when the last action in the THEN part is an EXIT, BREAK, SKIP, QUIT, ERROR. Bad code
|
||||
IF IsAdjmtBinCodeChanged THEN ERROR(AdjmtBinCodeChangeNotAllowedErr,...) ELSE ERROR(BinCodeChangeNotAllowedErr,...); Good code
|
||||
IF IsAdjmtBinCodeChanged THEN ERROR(AdjmtBinCodeChangeNotAllowedErr,...) ERROR(BinCodeChangeNotAllowedErr,...);</description></item><item><title>Unnecessary Function Parenthesis</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-function-parenthesis/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-function-parenthesis/</guid><description>Do not use parenthesis in a function call if the function does not have any parameters. Bad code
|
||||
IF IsAdjmtBinCodeChanged THEN ERROR(AdjmtBinCodeChangeNotAllowedErr,...) ERROR(BinCodeChangeNotAllowedErr,...);</description></item><item><title>Unnecessary Function Parenthesis</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-function-parenthesis/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-function-parenthesis/</guid><description>Do not use parenthesis in a function call if the function does not have any parameters. Bad code
|
||||
IF ReservMgt.IsPositive() THEN Good code
|
||||
IF ReservMgt.IsPositive THEN Bad code
|
||||
IF ChangeStatusForm.RUNMODAL() &lt;\&gt; ACTION::Yes THEN Good code
|
||||
IF ChangeStatusForm.RUNMODAL &lt;\&gt; ACTION::Yes THEN</description></item><item><title>Unnecessary Separators</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-separators/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-separators/</guid><description>There should be no unnecessary separators. Bad code
|
||||
IF ChangeStatusForm.RUNMODAL &lt;\&gt; ACTION::Yes THEN</description></item><item><title>Unnecessary Separators</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-separators/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-separators/</guid><description>There should be no unnecessary separators. Bad code
|
||||
IF Customer.FINDFIRST THEN;; Good code
|
||||
IF Customer.FINDFIRST THEN;</description></item><item><title>Unnecessary TRUE/FALSE</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-truefalse/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-truefalse/</guid><description>Do not use TRUE or FALSE keywords unnecessarily if the expression is already an logical expression. Bad code
|
||||
IF Customer.FINDFIRST THEN;</description></item><item><title>Unnecessary TRUE/FALSE</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-truefalse/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/unnecessary-truefalse/</guid><description>Do not use TRUE or FALSE keywords unnecessarily if the expression is already an logical expression. Bad code
|
||||
IF IsPositive() = TRUE THEN Good code
|
||||
IF IsPositive THEN Bad code
|
||||
IF Complete &lt;\&gt; TRUE THEN Good code
|
||||
IF NOT Complete THEN</description></item><item><title>Variable Already Scoped</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/variable-already-scoped/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/variable-already-scoped/</guid><description>Do not use scope &lsquo;&rsquo;.'' qualifier unnecessarily when a variable is already implicitly or explicitly scoped. It keeps the code simpler. Bad code
|
||||
IF NOT Complete THEN</description></item><item><title>Variable Already Scoped</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/variable-already-scoped/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/variable-already-scoped/</guid><description>Do not use scope &lsquo;&rsquo;.'' qualifier unnecessarily when a variable is already implicitly or explicitly scoped. It keeps the code simpler. Bad code
|
||||
ReturnRcptHeader.SETRANGE(ReturnRcptHeader.&quot;Return Order No.&quot;,&quot;Document No.&quot;); Good code
|
||||
ReturnRcptHeader.SETRANGE(&quot;Return Order No.&quot;,&quot;Document No.&quot;); Bad code
|
||||
WITH ChangeLogSetupTable DO BEGIN ... IF ChangeLogSetupTable.DELETE THEN ... END; Good code
|
||||
WITH ChangeLogSetupTable DO BEGIN ... IF DELETE THEN ... END;</description></item><item><title>Variable Naming</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/variable-naming/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/variable-naming/</guid><description>Variables that refer to a C/AL object must contain the objects name, abbreviated where necessary.
|
||||
WITH ChangeLogSetupTable DO BEGIN ... IF DELETE THEN ... END;</description></item><item><title>Variable Naming</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/variable-naming/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/variable-naming/</guid><description>Variables that refer to a C/AL object must contain the objects name, abbreviated where necessary.
|
||||
A variable must begin with a capital letter.
|
||||
Blanks, periods, and other characters (such as parentheses) that would make quotation marks around a variable necessary must be omitted.
|
||||
If a variable is a compound of two or more words or abbreviations, each word or abbreviation should begin with a capital letter. Bad code
|
||||
... WIPBuffer@1002 : Record 1018 .</description></item><item><title>Variables Declarations Order</title><link>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/variables-declarations-order/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bcalhelp.dev/navpatterns/3-cal-coding-guidelines/readability/variables-declarations-order/</guid><description>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. Bad code
|
||||
... WIPBuffer@1002 : Record 1018 .</description></item><item><title>Variables Declarations Order</title><link>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/variables-declarations-order/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/navpatterns/3-cal-coding-guidelines/readability/variables-declarations-order/</guid><description>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. Bad code
|
||||
StartingDateFilter@1002 : Text\[30\]; Vend@1003 : Record 23; Good code</description></item></channel></rss>
|
||||
Loading…
Add table
Add a link
Reference in a new issue