This commit is contained in:
TheDoubleH 2022-05-06 20:32:11 +00:00
parent 90010b11a8
commit 7f2b60c5ec
205 changed files with 244 additions and 219 deletions

View file

@ -484,7 +484,11 @@ Therefore it’s good practice to always check if the table is empty whe
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-al" data-lang="al"><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">Page</span><span style="color:#ce5c00;font-weight:bold">.</span>RunModal<span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#0000cf;font-weight:bold">525</span><span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline"> </span>SalesShptLine<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#000;font-weight:bold">;</span><span style="color:#f8f8f8;text-decoration:underline">
</span></span></span></code></pre></div><h2 id="good-code">Good code</h2>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-al" data-lang="al"><span style="display:flex;"><span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">Page</span><span style="color:#ce5c00;font-weight:bold">.</span>RunModal<span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#204a87;font-weight:bold">Page</span><span style="color:#000;font-weight:bold">::</span>"Posted Sales Shipment Lines"<span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline"> </span>SalesShptLine<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#000;font-weight:bold">;</span><span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Docs: One Statement per Line</title><link>https://alguidelines.dev/docs/bestpractices/one-statement-per-line/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/docs/bestpractices/one-statement-per-line/</guid><description>
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="tips">Tips&lt;/h2>
&lt;p>The &lt;a href="https://marketplace.visualstudio.com/items?itemName=StefanMaron.businesscentral-lintercop">BusinessCentral.LinterCop&lt;/a> extension adds a new rule to check your code for hardcoded object IDs.&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://github.com/StefanMaron/BusinessCentral.LinterCop/wiki/LC0012">LC0012&lt;/a>: Using hardcoded IDs in functions like Codeunit.Run() is not allowed.&lt;/li>
&lt;/ul></description></item><item><title>Docs: One Statement per Line</title><link>https://alguidelines.dev/docs/bestpractices/one-statement-per-line/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/docs/bestpractices/one-statement-per-line/</guid><description>
&lt;p>&lt;em>Created by Microsoft, Described by waldo&lt;/em>&lt;/p>
&lt;h2 id="description">Description&lt;/h2>
&lt;p>A line of code should not have more than one statement.&lt;/p>
@ -2164,7 +2168,12 @@ Therefore it&amp;rsquo;s good practice to always check if the table is empty whe
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="good-code">Good code&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-al" data-lang="al">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>Vendor&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">Record&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>Vendor&lt;span style="color:#000;font-weight:bold">;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>StartingDateFilter&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">Text&lt;/span>&lt;span style="color:#000;font-weight:bold">;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Docs: When not to use Blank Lines</title><link>https://alguidelines.dev/docs/bestpractices/blank-lines-when-not-to-use/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/docs/bestpractices/blank-lines-when-not-to-use/</guid><description>
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="tips">Tips&lt;/h2>
&lt;p>The &lt;a href="https://marketplace.visualstudio.com/items?itemName=andrzejzwierzchowski.al-code-outline">AZ AL Dev Tools/AL Code Outline&lt;/a> extension adds two new commands to Visual Studio Code to sorts variables.&lt;/p>
&lt;ul>
&lt;li>&lt;code>Sort Variables in the Active Editor&lt;/code> : sorts variables in the current editor&lt;/li>
&lt;li>&lt;code>Sort Variables in the Active Project&lt;/code> : sorts variables in the current project&lt;/li>
&lt;/ul></description></item><item><title>Docs: When not to use Blank Lines</title><link>https://alguidelines.dev/docs/bestpractices/blank-lines-when-not-to-use/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/docs/bestpractices/blank-lines-when-not-to-use/</guid><description>
&lt;p>Do not use blank lines:&lt;/p>
&lt;ul>
&lt;li>at the beginning or end of any functions (after &lt;code>begin&lt;/code> and before &lt;code>end&lt;/code>)&lt;/li>