deploy: 81ffc9da10
This commit is contained in:
parent
158b902b20
commit
cb4e8e2194
131 changed files with 3191 additions and 3076 deletions
|
|
@ -2,19 +2,19 @@
|
|||
<head>
|
||||
<meta charset=utf-8>
|
||||
<meta name=viewport content="width=device-width,initial-scale=1">
|
||||
<meta name=generator content="Hugo 0.89.0">
|
||||
<meta name=generator content="Hugo 0.89.1">
|
||||
<meta name=description content>
|
||||
<title>Data Driven Blocked Entity :: BC AL Help</title>
|
||||
<link href=/css/nucleus.css?1636104708 rel=stylesheet>
|
||||
<link href=/css/fontawesome-all.min.css?1636104708 rel=stylesheet>
|
||||
<link href=/css/featherlight.min.css?1636104708 rel=stylesheet>
|
||||
<link href=/css/perfect-scrollbar.min.css?1636104708 rel=stylesheet>
|
||||
<link href=/css/auto-complete.css?1636104708 rel=stylesheet>
|
||||
<link href=/css/theme.css?1636104708 rel=stylesheet>
|
||||
<link href=/css/theme-blue.css?1636104708 rel=stylesheet>
|
||||
<link href=/css/variant.css?1636104708 rel=stylesheet>
|
||||
<link href=/css/print.css?1636104708 rel=stylesheet media=print>
|
||||
<script src=/js/jquery.min.js?1636104708></script>
|
||||
<link href=/css/nucleus.css?1636386789 rel=stylesheet>
|
||||
<link href=/css/fontawesome-all.min.css?1636386789 rel=stylesheet>
|
||||
<link href=/css/featherlight.min.css?1636386789 rel=stylesheet>
|
||||
<link href=/css/perfect-scrollbar.min.css?1636386789 rel=stylesheet>
|
||||
<link href=/css/auto-complete.css?1636386789 rel=stylesheet>
|
||||
<link href=/css/theme.css?1636386789 rel=stylesheet>
|
||||
<link href=/css/theme-blue.css?1636386789 rel=stylesheet>
|
||||
<link href=/css/variant.css?1636386789 rel=stylesheet>
|
||||
<link href=/css/print.css?1636386789 rel=stylesheet media=print>
|
||||
<script src=/js/jquery.min.js?1636386789></script>
|
||||
<style>:root #header+#content>#left>#rlblock_left{display:none!important}</style>
|
||||
</head>
|
||||
<body data-url=/navpatterns/1-patterns/blocked-entity/data-driven-blocked-entity/>
|
||||
|
|
@ -32,9 +32,9 @@ BC AL Help . 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?1636104708></script>
|
||||
<script src=/js/auto-complete.js?1636104708></script>
|
||||
<script src=/js/search.js?1636104708></script>
|
||||
<script src=/js/lunr.min.js?1636386789></script>
|
||||
<script src=/js/auto-complete.js?1636386789></script>
|
||||
<script src=/js/search.js?1636386789></script>
|
||||
</div>
|
||||
<div class=highlightable>
|
||||
<ul class=topics>
|
||||
|
|
@ -199,7 +199,17 @@ BC AL Help . dev
|
|||
</div>
|
||||
<div class=progress>
|
||||
<div class=wrapper>
|
||||
<nav id=TableOfContents></nav>
|
||||
<nav id=TableOfContents>
|
||||
<ul>
|
||||
<li><a href=#abstract>Abstract</a></li>
|
||||
<li><a href=#problem>Problem</a></li>
|
||||
<li><a href=#solution>Solution</a></li>
|
||||
<li><a href=#example>Example</a></li>
|
||||
<li><a href=#nav-usage>NAV Usage</a></li>
|
||||
<li><a href=#consequences>Consequences</a></li>
|
||||
<li><a href=#nav-versions>NAV Versions</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -208,9 +218,9 @@ BC AL Help . dev
|
|||
<main id=body-inner>
|
||||
<h1>Data Driven Blocked Entity</h1>
|
||||
<p><em>Written by Bogdan Andrei Sturzoiu, at Microsoft Development Center Copenhagen</em></p>
|
||||
<p><strong>Abstract</strong></p>
|
||||
<h2 id=abstract>Abstract</h2>
|
||||
<p>This pattern implements a generic mechanism for dynamically restricting and allowing usage of a record by the business process administrator.</p>
|
||||
<p><strong>Problem</strong></p>
|
||||
<h2 id=problem>Problem</h2>
|
||||
<p>A NAV record can be used in a number of functionalities across the app. There are situations, however, when the administrator wants to restrict the consumption of such a record, as well as lift the restriction when it is no longer relevant.</p>
|
||||
<p>For example, a new customer record should not be used for posting documents until it is approved by the relevant approver.</p>
|
||||
<p>We could solve this by using the <a href=/nav/w/designpatterns/79.blocked-entity>Blocked Entity pattern</a>, but it requires database schema changes, which have an upgrade impact.</p>
|
||||
|
|
@ -220,7 +230,7 @@ BC AL Help . dev
|
|||
<li>Adding specific code for the record in every place where the restriction needs to be enforced.</li>
|
||||
</ol>
|
||||
<p>In contrast, the Data-driven Blocked Entity pattern involves adding a new record (data change) to mark the restriction, instead of adding a new field (metadata change).</p>
|
||||
<p><strong>Solution</strong></p>
|
||||
<h2 id=solution>Solution</h2>
|
||||
<p>This pattern describes a generic mechanism of adding and lifting restrictions for any type of record.</p>
|
||||
<p>The restriction mechanism has the following elements:</p>
|
||||
<ol>
|
||||
|
|
@ -234,8 +244,7 @@ BC AL Help . dev
|
|||
<li>A purpose (e.g. the record cannot be posted).</li>
|
||||
</ul>
|
||||
<p>You must make sure to differentiate between the reason and the purpose. That is because the restriction can only be added once per record, but consumed in multiple places.</p>
|
||||
<hr>
|
||||
<p><strong>Example</strong></p>
|
||||
<h2 id=example>Example</h2>
|
||||
<p>For example, we want to restrict posting Gen. Journal Lines if a customer has not been added in Account No. field.</p>
|
||||
<p>For this, the following components are needed:</p>
|
||||
<ol>
|
||||
|
|
@ -243,7 +252,7 @@ BC AL Help . dev
|
|||
<li>When you validate a Customer No. as Account no. and Customer as Account Type, lift the restrictions by calling AllowRecordUsage in COD1550.</li>
|
||||
<li>The consumption of the restriction at posting is already implemented as an event in TAB81, OnCheckGenJournalLinePostRestrictions. No further action necessary.</li>
|
||||
</ol>
|
||||
<p><strong>NAV Usage</strong></p>
|
||||
<h2 id=nav-usage>NAV Usage</h2>
|
||||
<p>All the approval workflows include a response that restricts usage of a record, and then, at the end of an approval loop, a response that allows the usage again by lifting the restriction. See responses “Add record restriction” and “Remove record restriction” implemented in COD1521.<a href=https://microsoft.sharepoint.com/teams/DynamicsNAV/Wiki/Nav%20Wiki%20Documents/NAV%20App%20Patterns/NAV%20App%20Patterns%20for%20Review/Data-Driven%20Blocked%20Entity.docx#_msocom_2><br>
|
||||
</a></p>
|
||||
<p>The code behind the “Add record restriction” workflow response:</p>
|
||||
|
|
@ -270,11 +279,10 @@ RecordRestrictionMgt.RestrictRecordUsage(RecRef.RECORDID,STRSUBSTNO(RestrictUsag
|
|||
RecordRestrictionMgt<span style=color:#f92672>.</span>AllowRecordUsage<span style=color:#f92672>(</span>RecRef<span style=color:#f92672>.</span><span style=color:#66d9ef>RECORDID</span><span style=color:#f92672>)</span>;
|
||||
<span style=color:#66d9ef>END</span>;
|
||||
</code></pre></div><p>Notice how lifting a restriction for a Gen. Journal Batch involves lifting all the restrictions for the individual journal lines in the batch (hence the special branching of the code).</p>
|
||||
<hr>
|
||||
<p><strong>Consequences</strong></p>
|
||||
<h2 id=consequences>Consequences</h2>
|
||||
<p>Currently, there can only be one restriction per record. There are no restriction types.</p>
|
||||
<p>In the future, a type field should be added to the restriction table, to allow adding restrictions for different purposes, and to refine their consumption. For example, a posting restriction might only be enforced for restrictions originating from approvals.</p>
|
||||
<p><strong>NAV Versions</strong></p>
|
||||
<h2 id=nav-versions>NAV Versions</h2>
|
||||
<p>This pattern has been introduced in Dynamics NAV 2016.</p>
|
||||
<footer class=footline>
|
||||
</footer>
|
||||
|
|
@ -288,12 +296,12 @@ RecordRestrictionMgt.RestrictRecordUsage(RecRef.RECORDID,STRSUBSTNO(RestrictUsag
|
|||
<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?1636104708></script>
|
||||
<script src=/js/perfect-scrollbar.min.js?1636104708></script>
|
||||
<script src=/js/perfect-scrollbar.jquery.min.js?1636104708></script>
|
||||
<script src=/js/jquery.svg.pan.zoom.js?1636104708></script>
|
||||
<script src=/js/featherlight.min.js?1636104708></script>
|
||||
<script src=/js/modernizr.custom-3.6.0.js?1636104708></script>
|
||||
<script src=/js/relearn.js?1636104708></script>
|
||||
<script src=/js/clipboard.min.js?1636386789></script>
|
||||
<script src=/js/perfect-scrollbar.min.js?1636386789></script>
|
||||
<script src=/js/perfect-scrollbar.jquery.min.js?1636386789></script>
|
||||
<script src=/js/jquery.svg.pan.zoom.js?1636386789></script>
|
||||
<script src=/js/featherlight.min.js?1636386789></script>
|
||||
<script src=/js/modernizr.custom-3.6.0.js?1636386789></script>
|
||||
<script src=/js/relearn.js?1636386789></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue