deploy: 9e06f72056
This commit is contained in:
parent
de09820554
commit
e4f08bf9a7
187 changed files with 6620 additions and 6342 deletions
|
|
@ -5,16 +5,16 @@
|
|||
<meta name=generator content="Hugo 0.92.1">
|
||||
<meta name=description content>
|
||||
<title>Read-once Initialization and Validation :: AL Guidelines</title>
|
||||
<link href=/css/nucleus.css?1644506468 rel=stylesheet>
|
||||
<link href=/css/fontawesome-all.min.css?1644506468 rel=stylesheet>
|
||||
<link href=/css/featherlight.min.css?1644506468 rel=stylesheet>
|
||||
<link href=/css/perfect-scrollbar.min.css?1644506468 rel=stylesheet>
|
||||
<link href=/css/auto-complete.css?1644506468 rel=stylesheet>
|
||||
<link href=/css/theme.css?1644506468 rel=stylesheet>
|
||||
<link href=/css/theme-blue.css?1644506468 rel=stylesheet>
|
||||
<link href=/css/variant.css?1644506468 rel=stylesheet>
|
||||
<link href=/css/print.css?1644506468 rel=stylesheet media=print>
|
||||
<script src=/js/jquery.min.js?1644506468></script>
|
||||
<link href=/css/nucleus.css?1644600599 rel=stylesheet>
|
||||
<link href=/css/fontawesome-all.min.css?1644600599 rel=stylesheet>
|
||||
<link href=/css/featherlight.min.css?1644600599 rel=stylesheet>
|
||||
<link href=/css/perfect-scrollbar.min.css?1644600599 rel=stylesheet>
|
||||
<link href=/css/auto-complete.css?1644600599 rel=stylesheet>
|
||||
<link href=/css/theme.css?1644600599 rel=stylesheet>
|
||||
<link href=/css/theme-blue.css?1644600599 rel=stylesheet>
|
||||
<link href=/css/variant.css?1644600599 rel=stylesheet>
|
||||
<link href=/css/print.css?1644600599 rel=stylesheet media=print>
|
||||
<script src=/js/jquery.min.js?1644600599></script>
|
||||
<style>:root #header+#content>#left>#rlblock_left{display:none!important}</style>
|
||||
</head>
|
||||
<body data-url=/navpatterns/1-patterns/read-once-initialization-and-validation/>
|
||||
|
|
@ -32,9 +32,9 @@ ALGuidelines.Dev
|
|||
<input data-search-input id=search-by type=search placeholder=Search...>
|
||||
<span data-search-clear><i class="fas fa-times"></i></span>
|
||||
</div>
|
||||
<script src=/js/lunr.min.js?1644506468></script>
|
||||
<script src=/js/auto-complete.js?1644506468></script>
|
||||
<script src=/js/search.js?1644506468></script>
|
||||
<script src=/js/lunr.min.js?1644600599></script>
|
||||
<script src=/js/auto-complete.js?1644600599></script>
|
||||
<script src=/js/search.js?1644600599></script>
|
||||
</div>
|
||||
<div class=highlightable>
|
||||
<ul class=topics>
|
||||
|
|
@ -248,13 +248,13 @@ ALGuidelines.Dev
|
|||
<div class=wrapper>
|
||||
<nav id=TableOfContents>
|
||||
<ul>
|
||||
<li><a href=#abstract><strong>Abstract</strong></a></li>
|
||||
<li><a href=#description><strong>Description</strong></a></li>
|
||||
<li><a href=#nav-specific-example><strong>NAV Specific Example</strong></a></li>
|
||||
<li><a href=#nav-usages><strong>NAV Usages</strong></a></li>
|
||||
<li><a href=#ideas-for-improvement><strong>Ideas for improvement</strong></a></li>
|
||||
<li><a href=#consequences><strong>Consequences</strong></a></li>
|
||||
<li><a href=#related-topics><strong>Related Topics</strong></a></li>
|
||||
<li><a href=#abstract>Abstract</a></li>
|
||||
<li><a href=#description>Description</a></li>
|
||||
<li><a href=#nav-specific-example>NAV Specific Example</a></li>
|
||||
<li><a href=#nav-usages>NAV Usages</a></li>
|
||||
<li><a href=#ideas-for-improvement>Ideas for improvement</a></li>
|
||||
<li><a href=#consequences>Consequences</a></li>
|
||||
<li><a href=#related-topics>Related Topics</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
|
@ -265,35 +265,32 @@ ALGuidelines.Dev
|
|||
<main id=body-inner>
|
||||
<h1>Read-once Initialization and Validation</h1>
|
||||
<p><em>By Tim Grant</em></p>
|
||||
<h2 id=abstract><strong>Abstract</strong></h2>
|
||||
<h2 id=abstract>Abstract</h2>
|
||||
<p>One time query and validation of a setup table.</p>
|
||||
<hr>
|
||||
<h2 id=description><strong>Description</strong></h2>
|
||||
<h2 id=description>Description</h2>
|
||||
<p>Firstly identifies if a setup table record is in memory, removing the need to execute and validate the re-query again within a code unit. (From NAV 2013+ service tier database caching exists).</p>
|
||||
<p>If you need to query a setup table, but not sure if the table is yet in memory from earlier code, this helps to determine this call (see Singleton Table pattern).</p>
|
||||
<p>Allows a central function to validate critical fields before processing automated code. <strong>TESTFIELD</strong> calls are added to the function and not the INIT call in order to ensure that critical functions do not run without this human check in place as these may rely on key configuration. If you have a design where specific field values are critical (custom or standard) for integrity, then INIT INSERT is a dangerous default which could result in the corruption of processes. This is separate automated INIT INSERT from a setup page.</p>
|
||||
<h2 id=nav-specific-example><strong>NAV Specific Example</strong></h2>
|
||||
<h2 id=nav-specific-example>NAV Specific Example</h2>
|
||||
<p>A global variable record and a global status indicator, but within the context of a local function.</p>
|
||||
<p><a href=6332.1.png><img src=6332.1.png alt=" "></a></p>
|
||||
<p><a href=5025.2.png><img src=5025.2.png alt=" "></a></p>
|
||||
<p><img src=5672.8.png alt=" "></p>
|
||||
<h2 id=nav-usages><strong>NAV Usages</strong></h2>
|
||||
<h2 id=nav-usages>NAV Usages</h2>
|
||||
<p>A similar example of this is in Codeunit 80, but without any validation.</p>
|
||||
<p><a href=4.png><img src=4.png alt=" "></a></p>
|
||||
<p>E.g. If there is a bespoke change, then this existing <strong>GetGLSetup</strong> can be called earlier to accommodate for an earlier bespoke change:</p>
|
||||
<p><a href=5.png></a><a href=2465.5.png><img src=2465.5.png alt=" "></a></p>
|
||||
<p>This means that by the time the code reaches the original <strong>GetGLSetup</strong> code requirement, this record is already in memory as the status flag is set to True, eliminating another check. For such Patterns the setup record should never be cleared, it should be called once globally, initiated and left in memory for future checks. It should <strong>not</strong> be declared locally at the same time, review your code for matching local variable usage before implementing this.</p>
|
||||
<hr>
|
||||
<h2 id=ideas-for-improvement><strong>Ideas for improvement</strong></h2>
|
||||
<h2 id=ideas-for-improvement>Ideas for improvement</h2>
|
||||
<p>Merge <strong>Singleton Table</strong> with dynamic validation field meta configuration. This removes the coding of <strong>TESTFIELD</strong> to a central setup check.</p>
|
||||
<p>Example with the <strong>Sales & Receivables Setup</strong></p>
|
||||
<p><a href=5857.1.png><img src=5857.1.png alt=" "></a></p>
|
||||
<p><a href=4477.2.png><img src=4477.2.png alt=" "></a></p>
|
||||
<p><a href=4314.3.png><img src=4314.3.png alt=" "></a></p>
|
||||
<hr>
|
||||
<h2 id=consequences><strong>Consequences</strong></h2>
|
||||
<h2 id=consequences>Consequences</h2>
|
||||
<p>If in the circumstance that a field value in the setup table is expected to change within the life of the code component instance. e.g. If a CHANGECOMPANY is required to cross reference another Setup table, use a separate variable.</p>
|
||||
<h2 id=related-topics><strong>Related Topics</strong></h2>
|
||||
<h2 id=related-topics>Related Topics</h2>
|
||||
<p>This is related to the <strong>Singleton Table</strong> pattern.</p>
|
||||
<footer class=footline>
|
||||
</footer>
|
||||
|
|
@ -307,12 +304,12 @@ ALGuidelines.Dev
|
|||
<div style=left:-1000px;overflow:scroll;position:absolute;top:-1000px;border:none;box-sizing:content-box;height:200px;margin:0;padding:0;width:200px>
|
||||
<div style=border:none;box-sizing:content-box;height:200px;margin:0;padding:0;width:200px></div>
|
||||
</div>
|
||||
<script src=/js/clipboard.min.js?1644506468></script>
|
||||
<script src=/js/perfect-scrollbar.min.js?1644506468></script>
|
||||
<script src=/js/perfect-scrollbar.jquery.min.js?1644506468></script>
|
||||
<script src=/js/jquery.svg.pan.zoom.js?1644506468></script>
|
||||
<script src=/js/featherlight.min.js?1644506468></script>
|
||||
<script src=/js/modernizr.custom-3.6.0.js?1644506468></script>
|
||||
<script src=/js/relearn.js?1644506468></script>
|
||||
<script src=/js/clipboard.min.js?1644600599></script>
|
||||
<script src=/js/perfect-scrollbar.min.js?1644600599></script>
|
||||
<script src=/js/perfect-scrollbar.jquery.min.js?1644600599></script>
|
||||
<script src=/js/jquery.svg.pan.zoom.js?1644600599></script>
|
||||
<script src=/js/featherlight.min.js?1644600599></script>
|
||||
<script src=/js/modernizr.custom-3.6.0.js?1644600599></script>
|
||||
<script src=/js/relearn.js?1644600599></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue