This commit is contained in:
waldo1001 2022-06-22 09:25:03 +00:00
parent f25c8d4845
commit 76c6fda05c
203 changed files with 409 additions and 409 deletions

View file

@ -1,9 +1,9 @@
<!doctype html><html lang=en class=no-js><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=generator content="Hugo 0.100.2"><meta name=robots content="index, follow"><link rel="shortcut icon" href=/favicons/favicon.ico><link rel=apple-touch-icon href=/favicons/apple-touch-icon-180x180.png sizes=180x180><link rel=icon type=image/png href=/favicons/favicon-16x16.png sizes=16x16><link rel=icon type=image/png href=/favicons/favicon-32x32.png sizes=32x32><link rel=icon type=image/png href=/favicons/android-36x36.png sizes=36x36><link rel=icon type=image/png href=/favicons/android-48x48.png sizes=48x48><link rel=icon type=image/png href=/favicons/android-72x72.png sizes=72x72><link rel=icon type=image/png href=/favicons/android-96x96.png sizes=96x96><link rel=icon type=image/png href=/favicons/android-144x144.png sizes=144x144><link rel=icon type=image/png href=/favicons/android-192x192.png sizes=192x192><title>Error Message Processing | alguidelines.dev - Business Central Design Patterns</title><meta name=description content="By Jesper Schulz at Microsoft Development Center Copenhagen
<!doctype html><html lang=en class=no-js><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=generator content="Hugo 0.101.0"><meta name=robots content="index, follow"><link rel="shortcut icon" href=/favicons/favicon.ico><link rel=apple-touch-icon href=/favicons/apple-touch-icon-180x180.png sizes=180x180><link rel=icon type=image/png href=/favicons/favicon-16x16.png sizes=16x16><link rel=icon type=image/png href=/favicons/favicon-32x32.png sizes=32x32><link rel=icon type=image/png href=/favicons/android-36x36.png sizes=36x36><link rel=icon type=image/png href=/favicons/android-48x48.png sizes=48x48><link rel=icon type=image/png href=/favicons/android-72x72.png sizes=72x72><link rel=icon type=image/png href=/favicons/android-96x96.png sizes=96x96><link rel=icon type=image/png href=/favicons/android-144x144.png sizes=144x144><link rel=icon type=image/png href=/favicons/android-192x192.png sizes=192x192><title>Error Message Processing | alguidelines.dev - Business Central Design Patterns</title><meta name=description content="By Jesper Schulz at Microsoft Development Center Copenhagen
Note: This pattern describes new functionality which makes it possible to generalize the …"><meta property="og:title" content="Error Message Processing"><meta property="og:description" content="By Jesper Schulz at Microsoft Development Center Copenhagen
Note: This pattern describes new functionality which makes it possible to generalize the Journal Error Processing pattern.
Abstract Missing, invalid or incomplete data is a common issue during data processing in NAV. This article describes how to collect all error messages during processing using the error message component and present them to the user in a unified way, which enables the user to correct the errors efficiently."><meta property="og:type" content="article"><meta property="og:url" content="https://alguidelines.dev/docs/navpatterns/patterns/error-message-processing/"><meta property="og:image" content="https://alguidelines.dev/images/og-image-fission.png"><meta property="article:section" content="docs"><meta property="article:modified_time" content="2022-02-24T14:45:35+01:00"><meta property="og:site_name" content="alguidelines.dev - Business Central Design Patterns"><meta itemprop=name content="Error Message Processing"><meta itemprop=description content="By Jesper Schulz at Microsoft Development Center Copenhagen
Abstract Missing, invalid or incomplete data is a common issue during data processing in NAV. This article describes how to collect all error messages during processing using the error message component and present them to the user in a unified way, which enables the user to correct the errors efficiently."><meta property="og:type" content="article"><meta property="og:url" content="https://alguidelines.dev/docs/navpatterns/patterns/error-message-processing/"><meta property="og:image" content="https://alguidelines.dev/images/og-image-fission.png"><meta property="article:section" content="docs"><meta property="article:modified_time" content="2022-06-22T11:23:49+02:00"><meta property="og:site_name" content="alguidelines.dev - Business Central Design Patterns"><meta itemprop=name content="Error Message Processing"><meta itemprop=description content="By Jesper Schulz at Microsoft Development Center Copenhagen
Note: This pattern describes new functionality which makes it possible to generalize the Journal Error Processing pattern.
Abstract Missing, invalid or incomplete data is a common issue during data processing in NAV. This article describes how to collect all error messages during processing using the error message component and present them to the user in a unified way, which enables the user to correct the errors efficiently."><meta itemprop=dateModified content="2022-02-24T14:45:35+01:00"><meta itemprop=wordCount content="835"><meta itemprop=image content="https://alguidelines.dev/images/og-image-fission.png"><meta itemprop=keywords content="C/AL,"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="https://alguidelines.dev/images/og-image-fission.png"><meta name=twitter:title content="Error Message Processing"><meta name=twitter:description content="By Jesper Schulz at Microsoft Development Center Copenhagen
Abstract Missing, invalid or incomplete data is a common issue during data processing in NAV. This article describes how to collect all error messages during processing using the error message component and present them to the user in a unified way, which enables the user to correct the errors efficiently."><meta itemprop=dateModified content="2022-06-22T11:23:49+02:00"><meta itemprop=wordCount content="835"><meta itemprop=image content="https://alguidelines.dev/images/og-image-fission.png"><meta itemprop=keywords content="C/AL,"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="https://alguidelines.dev/images/og-image-fission.png"><meta name=twitter:title content="Error Message Processing"><meta name=twitter:description content="By Jesper Schulz at Microsoft Development Center Copenhagen
Note: This pattern describes new functionality which makes it possible to generalize the Journal Error Processing pattern.
Abstract Missing, invalid or incomplete data is a common issue during data processing in NAV. This article describes how to collect all error messages during processing using the error message component and present them to the user in a unified way, which enables the user to correct the errors efficiently."><link rel=preload href=/scss/main.min.84a617ff0c0265eb62b5cd2929c572f4ed37dc4907d0cf068be4eb2974f6d60f.css as=style><link href=/scss/main.min.84a617ff0c0265eb62b5cd2929c572f4ed37dc4907d0cf068be4eb2974f6d60f.css rel=stylesheet integrity><script src=https://code.jquery.com/jquery-3.6.0.min.js integrity=sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK crossorigin=anonymous></script>
<script src=https://unpkg.com/lunr@2.3.9/lunr.min.js integrity=sha384-203J0SNzyqHby3iU6hzvzltrWi/M41wOP5Gu+BiJMz5nwKykbkUx8Kp7iti0Lpli crossorigin=anonymous></script></head><body class=td-page><header><nav class="js-navbar-scroll navbar navbar-expand navbar-dark flex-column flex-md-row td-navbar"><a class=navbar-brand href=/><img src=/images/SiteLogo.png height=32px>
@ -43,13 +43,13 @@ Abstract Missing, invalid or incomplete data is a common issue during data proce
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>END</span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>ELSE</span><span style=color:#f8f8f8;text-decoration:underline>
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span>TempErrorMessage<span style=color:#ce5c00;font-weight:700>.</span>LogSimpleMessage<span style=color:#ce5c00;font-weight:700>(</span>TempErrorMessage<span style=color:#ce5c00;font-weight:700>.</span>&#34;Message Type&#34;<span style=color:#000;font-weight:700>::</span>Error<span style=color:#000;font-weight:700>,</span>NoSATAccountDefinedErr<span style=color:#ce5c00;font-weight:700>)</span><span style=color:#000;font-weight:700>;</span><span style=color:#f8f8f8;text-decoration:underline>
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline>
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>IF</span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>NOT</span><span style=color:#f8f8f8;text-decoration:underline> </span>TempErrorMessage<span style=color:#ce5c00;font-weight:700>.</span>HasErrors<span style=color:#ce5c00;font-weight:700>(</span>TRUE<span style=color:#ce5c00;font-weight:700>) </span><span style=color:#204a87;font-weight:700>THEN</span><span style=color:#f8f8f8;text-decoration:underline>
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span>SaveXMLToClient<span style=color:#ce5c00;font-weight:700>(</span>Document<span style=color:#000;font-weight:700>,</span>Year<span style=color:#000;font-weight:700>,</span>Month<span style=color:#000;font-weight:700>,</span><span style=color:#4e9a06>&#39;CT&#39;</span><span style=color:#ce5c00;font-weight:700>)</span><span style=color:#000;font-weight:700>;</span><span style=color:#f8f8f8;text-decoration:underline>
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span>TempErrorMessage<span style=color:#ce5c00;font-weight:700>.</span>ShowErrorMessages<span style=color:#ce5c00;font-weight:700>(</span>FALSE<span style=color:#ce5c00;font-weight:700>)</span><span style=color:#000;font-weight:700>;</span><span style=color:#f8f8f8;text-decoration:underline>
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>IF</span><span style=color:#f8f8f8;text-decoration:underline> </span><span style=color:#204a87;font-weight:700>NOT</span><span style=color:#f8f8f8;text-decoration:underline> </span>TempErrorMessage<span style=color:#ce5c00;font-weight:700>.</span>HasErrors<span style=color:#ce5c00;font-weight:700>(</span>TRUE<span style=color:#ce5c00;font-weight:700>) </span><span style=color:#204a87;font-weight:700>THEN</span><span style=color:#f8f8f8;text-decoration:underline>
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span>SaveXMLToClient<span style=color:#ce5c00;font-weight:700>(</span>Document<span style=color:#000;font-weight:700>,</span>Year<span style=color:#000;font-weight:700>,</span>Month<span style=color:#000;font-weight:700>,</span><span style=color:#4e9a06>&#39;CT&#39;</span><span style=color:#ce5c00;font-weight:700>)</span><span style=color:#000;font-weight:700>;</span><span style=color:#f8f8f8;text-decoration:underline>
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline> </span>TempErrorMessage<span style=color:#ce5c00;font-weight:700>.</span>ShowErrorMessages<span style=color:#ce5c00;font-weight:700>(</span>FALSE<span style=color:#ce5c00;font-weight:700>)</span><span style=color:#000;font-weight:700>;</span><span style=color:#f8f8f8;text-decoration:underline>
</span></span></span><span style=display:flex><span><span style=color:#f8f8f8;text-decoration:underline></span><span style=color:#204a87;font-weight:700>END</span><span style=color:#000;font-weight:700>;</span><span style=color:#f8f8f8;text-decoration:underline>
</span></span></span></code></pre></div><p>One could also do pre-processing in a function of its own, and only if the pre-processing results in no error messages of type &ldquo;Error&rdquo; would the processing continue.</p><h2 id=ideas-for-improvement>Ideas for improvement</h2><p>By using this easy to use component, we have the possibility to extend this functionality going forward. A nice addition to the error message component would be the possibility to log the error messages persistently in a grouped manner, thereby allowing 3rd parties to see the issues the users bump into the most, or allowing 3rd parties to get an detailed insight into what happened, thereby enabling them to provide better support.</p><div class="text-muted mt-5 pt-3 border-top">Last modified February 24, 2022: <a href=https://github.com/microsoft/alguidelines/commit/5ee0436639455a35835c5ce88241d3fad662ee06>Added tags & categories + cleanup (5ee04366)</a>
by waldo1001</div></div></main></div></div><footer class="bg-dark py-5 row d-print-none"><div class="container-fluid mx-sm-5"><div class=row><div class="col-6 col-sm-4 text-xs-center order-sm-2"><ul class="list-inline mb-0"><li class="list-inline-item mx-2 h3" data-toggle=tooltip data-placement=top title=GitHub aria-label=GitHub><a class=text-white target=_blank rel=noopener href=https://github.com/microsoft/alguidelines aria-label=GitHub><i class="fab fa-github"></i></a></li><li class="list-inline-item mx-2 h3" data-toggle=tooltip data-placement=top title=Twitter aria-label=Twitter><a class=text-white target=_blank rel=noopener href="https://twitter.com/search?q=%23bcalhelp" aria-label=Twitter><i class="fab fa-twitter"></i></a></li><li class="list-inline-item mx-2 h3" data-toggle=tooltip data-placement=top title=Discord aria-label=Discord><a class=text-white target=_blank rel=noopener href=https://discord.gg/4wbfNv3 aria-label=Discord><i class="fab fa-discord"></i></a></li></ul></div><div class="col-6 col-sm-4 text-right text-xs-center order-sm-3"></div><div class="col-12 col-sm-4 text-center py-2 order-sm-2"><small class=text-white>&copy; 2022 alguidelines.dev Project All Rights Reserved</small></div></div></div></footer></div><script src=https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js integrity=sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN crossorigin=anonymous></script>
</span></span></span></code></pre></div><p>One could also do pre-processing in a function of its own, and only if the pre-processing results in no error messages of type &ldquo;Error&rdquo; would the processing continue.</p><h2 id=ideas-for-improvement>Ideas for improvement</h2><p>By using this easy to use component, we have the possibility to extend this functionality going forward. A nice addition to the error message component would be the possibility to log the error messages persistently in a grouped manner, thereby allowing 3rd parties to see the issues the users bump into the most, or allowing 3rd parties to get an detailed insight into what happened, thereby enabling them to provide better support.</p><div class="text-muted mt-5 pt-3 border-top">Last modified June 22, 2022: <a href=https://github.com/microsoft/alguidelines/commit/3dd196bc220a77fa428f1b67bf1780ff46d95851>Fixed indentation (#188) (3dd196bc)</a>
by waldo</div></div></main></div></div><footer class="bg-dark py-5 row d-print-none"><div class="container-fluid mx-sm-5"><div class=row><div class="col-6 col-sm-4 text-xs-center order-sm-2"><ul class="list-inline mb-0"><li class="list-inline-item mx-2 h3" data-toggle=tooltip data-placement=top title=GitHub aria-label=GitHub><a class=text-white target=_blank rel=noopener href=https://github.com/microsoft/alguidelines aria-label=GitHub><i class="fab fa-github"></i></a></li><li class="list-inline-item mx-2 h3" data-toggle=tooltip data-placement=top title=Twitter aria-label=Twitter><a class=text-white target=_blank rel=noopener href="https://twitter.com/search?q=%23bcalhelp" aria-label=Twitter><i class="fab fa-twitter"></i></a></li><li class="list-inline-item mx-2 h3" data-toggle=tooltip data-placement=top title=Discord aria-label=Discord><a class=text-white target=_blank rel=noopener href=https://discord.gg/4wbfNv3 aria-label=Discord><i class="fab fa-discord"></i></a></li></ul></div><div class="col-6 col-sm-4 text-right text-xs-center order-sm-3"></div><div class="col-12 col-sm-4 text-center py-2 order-sm-2"><small class=text-white>&copy; 2022 alguidelines.dev Project All Rights Reserved</small></div></div></div></footer></div><script src=https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js integrity=sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN crossorigin=anonymous></script>
<script src=https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.min.js integrity="sha512-UR25UO94eTnCVwjbXozyeVd6ZqpaAE9naiEUBK/A+QDbfSTQFhPGj5lOR6d8tsgbBk84Ggb5A3EkjsOgPRPcKA==" crossorigin=anonymous></script>
<script src=https://cdn.jsdelivr.net/npm/mermaid@8.13.4/dist/mermaid.min.js integrity="sha512-JERecFUBbsm75UpkVheAuDOE8NdHjQBrPACfEQYPwvPG+fjgCpHAz1Jw2ci9EXmd3DdfiWth3O3CQvcfEg8gsA==" crossorigin=anonymous></script>
<script src=/js/tabpane-persist.js></script>
<script src=/js/main.min.39671db2bf536be4ab42823526d15553e457b44c2771449fd5ccf90e7d19e482.js integrity="sha256-OWcdsr9Ta+SrQoI1JtFVU+RXtEwncUSf1cz5Dn0Z5II=" crossorigin=anonymous></script></body></html>
<script src=/js/main.min.9021b54d402798091af52a2fc8b747e6c5076e5f1323b276dc25e0774fb46c2d.js integrity="sha256-kCG1TUAnmAka9SovyLdH5sUHbl8TI7J23CXgd0+0bC0=" crossorigin=anonymous></script></body></html>