{"id":45582,"date":"2022-09-29T09:19:44","date_gmt":"2022-09-29T08:19:44","guid":{"rendered":"https:\/\/arquiconsult.com\/?p=45582"},"modified":"2024-10-23T10:46:32","modified_gmt":"2024-10-23T09:46:32","slug":"isolated-events","status":"publish","type":"post","link":"https:\/\/arquiconsult.com\/en\/isolated-events\/","title":{"rendered":"#028 ISOLATED EVENTS"},"content":{"rendered":"<div class=\"services_vertical horizontal_services row\" style=\"background-color: #f7f7f7; padding: 25px; border-radius: 5px; text-align: justify;\">\n<p>From D365BC 2022 Wave 1 Release (a.k.a. BC20), events definition have a new parameter: <strong>Isolated<\/strong>. When set to true, the event runs in an isolated mode, meaning that even if the event fails the application will not throw an error, and other calls will continue to be executed without a critical error stopping it.<\/p>\n<p>For example, it is usual for partners to add business logic to the login process, which is normally added to the <strong>OnAfterLoginStart<\/strong> event of the <strong>LogInManagement<\/strong> Codeunit. Unfortunately, these often raise errors and break the sign-in process. \u00a0Given that, Microsoft is replacing that event by the new <strong>OnAfterLogin<\/strong> event in the <strong>System Initialization<\/strong> Codeunit, which is an Isolated Event.<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>With this new feature, subscribing an isolated event will grant us that even if the code breaks, the further code will continue to be executed.<\/p>\n<p><strong>How to create and subscribe an Isolated Event:<\/strong><\/p>\n<p>1. Create an Integration Event and set the <strong>Isolated<\/strong> parameter to true<strong>:<\/strong><\/p>\n<p><img loading=\"lazy\" class=\"size-medium wp-image-45586 aligncenter\" src=\"https:\/\/arquiconsult.com\/wp-content\/uploads\/2022\/09\/Create-an-Integration-Event-and-set-the-Isolated-parameter-to-true-640x154.png\" alt=\"Create an Integration Event and set the Isolated parameter to true\" width=\"640\" height=\"154\" srcset=\"https:\/\/arquiconsult.com\/wp-content\/uploads\/2022\/09\/Create-an-Integration-Event-and-set-the-Isolated-parameter-to-true-640x154.png 640w, https:\/\/arquiconsult.com\/wp-content\/uploads\/2022\/09\/Create-an-Integration-Event-and-set-the-Isolated-parameter-to-true.png 727w\" sizes=\"(max-width: 640px) 100vw, 640px\" title=\"-\"><\/p>\n<p>2. Subscribe the event and add an error message:<\/p>\n<p><img loading=\"lazy\" class=\"size-medium wp-image-45589 aligncenter\" src=\"https:\/\/arquiconsult.com\/wp-content\/uploads\/2022\/09\/Subscribe-the-event-and-add-an-error-message-640x131.png\" alt=\"Subscribe the event and add an error message\" width=\"640\" height=\"131\" srcset=\"https:\/\/arquiconsult.com\/wp-content\/uploads\/2022\/09\/Subscribe-the-event-and-add-an-error-message-640x131.png 640w, https:\/\/arquiconsult.com\/wp-content\/uploads\/2022\/09\/Subscribe-the-event-and-add-an-error-message-768x157.png 768w, https:\/\/arquiconsult.com\/wp-content\/uploads\/2022\/09\/Subscribe-the-event-and-add-an-error-message.png 840w\" sizes=\"(max-width: 640px) 100vw, 640px\" title=\"-\"><\/p>\n<p>3. Open the Page where the Event is published. There are two possible outcomes depending on the Event definition Isolated parameter:<\/p>\n<p>a. If <strong>Isolated = true<\/strong>: The page opens without breaking on the Error occurrence;<\/p>\n<p>b. If <strong>Isolated = false<\/strong>: The page opens and the error is thrown (the behavior as seen in previous versions).<\/p>\n<p>&nbsp;<\/p>\n<!--themify_builder_content-->\n<div id=\"themify_builder_content-45582\" data-postid=\"45582\" class=\"themify_builder_content themify_builder_content-45582 themify_builder tf_clear\">\n    \t<!-- module_row -->\n\t<div  data-lazy=\"1\" class=\"module_row themify_builder_row tb_nus1581 tb_first tf_clearfix\">\n\t    \t\t<div class=\"row_inner col_align_top col-count-1 tf_box tf_w tf_rel\">\n\t\t\t<div  data-lazy=\"1\" class=\"module_column tb-column col-full first tb_cai8581 tf_box\">\n\t\t\t    \t        <div class=\"tb-column-inner tf_box tf_w\">\n\t\t    <!-- module text -->\n<div  class=\"module module-text tb_9tkr581 arquitps-data  \" data-lazy=\"1\">\n        <div  class=\"tb_text_wrap\">\n    <p><script>\njQuery(\".tbp_post_month:contains(Janeiro)\").html(\"January\");\n\njQuery(\".tbp_post_month:contains(Fevereiro)\").html(\"February\");\n\n\njQuery(\".tbp_post_month:contains(Mar\u00e7o)\").html(\"March\");\n\n\njQuery(\".tbp_post_month:contains(Abril)\").html(\"April\");\n\n\njQuery(\".tbp_post_month:contains(Maio)\").html(\"May\");\n\n\njQuery(\".tbp_post_month:contains(Junho)\").html(\"June\");\n\n\njQuery(\".tbp_post_month:contains(Julho)\").html(\"July\");\n\njQuery(\".tbp_post_month:contains(Agosto)\").html(\"August\");\n\njQuery(\".tbp_post_month:contains(Setembro)\").html(\"September\");\n\njQuery(\".tbp_post_month:contains(Outubro)\").html(\"October\");\n\njQuery(\".tbp_post_month:contains(Novembro)\").html(\"November\");\n\njQuery(\".tbp_post_month:contains(Dezembro)\").html(\"December\");\t\n\n\n\n<\/script><\/p>    <\/div>\n<\/div>\n<!-- \/module text -->\t        <\/div>\n\t    \t<\/div>\n\t\t    <\/div>\n\t    <!-- \/row_inner -->\n\t<\/div>\n\t<!-- \/module_row -->\n\t\t<!-- module_row -->\n\t<div  data-anchor=\"sucesso\" data-hide-anchor=\"1\" data-lazy=\"1\" class=\"module_row themify_builder_row sucesso repeat tb_has_section tb_section-sucesso tb_37yj250 tf_clearfix\" >\n\t    \t\t<div class=\"row_inner col_align_top col-count-1 tf_box tf_w tf_rel\">\n\t\t\t<div  data-lazy=\"1\" class=\"module_column tb-column col-full first tb_pwab250 tf_box\">\n\t\t\t    \t        <div class=\"tb-column-inner tf_box tf_w\">\n\t\t    <!-- module buttons -->\n<div  class=\"module module-buttons tb_ey5i250 buttons-horizontal transparent popmake-24705 large circle tf_textc\" data-lazy=\"1\">\n    \t<div class=\"module-buttons-item tf_inline_b\">\n\t\t\t\t\t\t\t<a href=\"#\" class=\"ui builder_button tb_default_color\" >\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"tf_inline_b tf_vmiddle\">Give as a Feedback and Suggest Questions<\/span>\n\t\t\t\t\t\t\t\t\t\t\t<\/a>\n\t\t\t    \t<\/div>\n\t<\/div>\n<!-- \/module buttons -->\n\t        <\/div>\n\t    \t<\/div>\n\t\t    <\/div>\n\t    <!-- \/row_inner -->\n\t<\/div>\n\t<!-- \/module_row -->\n\t<\/div>\n<!--\/themify_builder_content-->\n","protected":false},"excerpt":{"rendered":"<p>From D365BC 2022 Wave 1 Release (a.k.a. BC20), events definition have a new parameter: Isolated. When set to true, the event runs in an isolated mode, meaning that even if the event fails the application will not throw an error, and other calls will continue to be executed without a critical error stopping it. For [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":45602,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2099,2124],"tags":[2076,1395],"acf":[],"_links":{"self":[{"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/posts\/45582"}],"collection":[{"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/comments?post=45582"}],"version-history":[{"count":0,"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/posts\/45582\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/media\/45602"}],"wp:attachment":[{"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/media?parent=45582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/categories?post=45582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/tags?post=45582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}