{"id":2652,"date":"2016-04-18T18:23:19","date_gmt":"2016-04-18T12:53:19","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=2652"},"modified":"2016-04-18T18:23:19","modified_gmt":"2016-04-18T12:53:19","slug":"trigger-business-rules-on-change-of-stages-of-business-process-flow","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2016\/04\/trigger-business-rules-on-change-of-stages-of-business-process-flow\/","title":{"rendered":"Trigger Business Rules on change of Stages of Business Process Flow"},"content":{"rendered":"<p><b>Introduction:<\/b><\/p>\n<p style=\"text-align: justify;\">Among many advanced features introduced in Microsoft Dynamics CRM 2016, one would be business rules getting invoked by a business process flow. Earlier with MSCRM 2013, business rules were introduced to provide custom business logic and eliminate the need of writing scripts around this logic. But now with Dynamics CRM 2016, some of the UI based logic whose behaviour depends on Business Process Flow and its stages can be handled easily.<\/p>\n<p style=\"text-align: justify;\">In this blog we will take a look at how the business rules get invoked.<\/p>\n<p style=\"text-align: justify;\"><b>Example:<\/b><\/p>\n<p style=\"text-align: justify;\">Consider a scenario, where the management at a health care unit uses CRM to provide medical services to patients. As per the policy, 50% discount is given to the patients whose age is either equal to or greater than 60 years after they have received treatment. In order to keep a track of their patients, the management at the health care unit adhere to a business process flow. Depending on the age of the patient, the stages of the Business Process Flow can be changed. Now, based on the various stages, if we want to show \/ hide the discount field, which is by default disabled <b>(hidden)<\/b> on the Patient form then follow the business process flow as shown in the screenshots below.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image.png\"><img decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image_thumb.png\" alt=\"Trigger Business Rules\" width=\"725\" height=\"698\" border=\"0\" \/><\/a><\/p>\n<p>Now we will use this Business Process Flow and its stage as a condition set in Business Rules. When the stage <b>\u2018Is A Senior Citizen\u2019<\/b> is selected or active the hidden field i.e. <b>\u2018Senior Citizen Discount %\u2019<\/b> field can be displayed using Business Rules as follows.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image1.png\"><img decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image_thumb1.png\" alt=\"Trigger Business Rules in crm\" width=\"728\" height=\"121\" border=\"0\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">As you can see we have selected Business Process in the<b> \u2018Field\u2019<\/b> section of the Condition, and have selected the second option i.e. <b>\u2018Value With Stage\u2019<\/b> among the two options provided in the <b>\u2018Type\u2019<\/b> field. Once <b>\u2018Value With Stage\u2019<\/b> is selected another line is added to filter out our condition depending on the Stage of the Business Process Flow. So, we get the values as shown in the screenshot below.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image2.png\"><img decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image_thumb2.png\" alt=\"Trigger Business Rules in Dynamics CRM\" width=\"721\" height=\"163\" border=\"0\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">The CRM provides you with two options <b>\u2018Active Stage\u2019<\/b> and <b>\u2018Selected Stage\u2019<\/b> with which we can define whether we want actions to be performed when the stage is either selected or when the stage is active.<\/p>\n<p style=\"text-align: justify;\"><b>Note: &#8211;<\/b> If a Business Process Flow isn\u2019t present regarding an entity then, while creating a Business Rule you would<\/p>\n<p style=\"text-align: justify;\">Find the Value field to be locked because you won\u2019t have any process to access, as shown below<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image3.png\"><img decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image_thumb3.png\" alt=\"Trigger Business Rules\" width=\"744\" height=\"132\" border=\"0\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image4.png\"><img decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image_thumb4.png\" alt=\"image\" width=\"520\" height=\"340\" border=\"0\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">As per our Business Rule shown above, the field <b>\u2018Senior Citizen Discount %\u2019<\/b> is made visible on the <b>\u2018Patient\u2019<\/b> form which is by default hidden, when we select the stage <b>\u2018Is A Senior Citizen\u2019.<\/b><\/p>\n<p style=\"text-align: justify;\"><b>Note: &#8211;<\/b> There is major difference between <b>\u2018Selected Stage\u2019<\/b> and <b>\u2018Active Stage\u2019<\/b> that one needs to understand.<\/p>\n<p style=\"text-align: justify;\">&#8211; <b>\u2018Selected Stage<\/b> is when you select any stage of the Business Process Flow manually irrespective of it being active or inactive.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image5.png\"><img decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image_thumb5.png\" alt=\"Selected Stage\" width=\"482\" height=\"230\" border=\"0\" \/><\/a><\/p>\n<p>&#8211; <b>\u2018Active Stage\u2019<\/b> is when the process is currently residing in a particular stage as per its flow that has been pre-defined or preset.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image6.png\"><img decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image_thumb6.png\" alt=\"Active Stage\" width=\"347\" height=\"218\" border=\"0\" \/><\/a><\/p>\n<p>Our <b>\u2018Business Rule\u2019<\/b> will work in the following manner, as shown in the image below.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image7.png\"><img decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image_thumb7.png\" alt=\"Business Rule\" width=\"741\" height=\"291\" border=\"0\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">As you can see in the above image <b>\u2018Senior Citizen Discount %\u2019<\/b> field is not visible. But as soon as we select the <b>\u2018Is A Senior Citizen\u2019<\/b> stage of the Business Process Flow the <b>\u2018Senior Citizen Discount %\u2019<\/b> field becomes visible, as shown in the image below with red boxes.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image8.png\"><img decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image_thumb8.png\" alt=\"Business Rule\" width=\"755\" height=\"275\" border=\"0\" \/><\/a><\/p>\n<p>Then we can enter some information to the field, as shown below<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image9.png\"><img decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2016\/04\/image_thumb9.png\" alt=\"Business Rule in CRM\" width=\"762\" height=\"353\" border=\"0\" \/><\/a><\/p>\n<p><b>Conclusion:<\/b><\/p>\n<p style=\"text-align: justify;\">It is therefore evident from the screenshots as above that scripts need not be written for performing UI based actions on the form in Dynamics CRM 2016. Instead, rules can be used for the business process flows to streamline the experience and lead the user towards the desired outcome.<\/p>\n<p style=\"text-align: justify;\">You may like to revisit our last quarter most popular <a href=\"http:\/\/bit.ly\/1PNsB4P\" target=\"_blank\" rel=\"noopener noreferrer\">Blogs<\/a> about Dynamics CRM.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Among many advanced features introduced in Microsoft Dynamics CRM 2016, one would be business rules getting invoked by a business process flow. Earlier with MSCRM 2013, business rules were introduced to provide custom business logic and eliminate the need of writing scripts around this logic. But now with Dynamics CRM 2016, some of the\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2016\/04\/trigger-business-rules-on-change-of-stages-of-business-process-flow\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[13,19],"tags":[225,234,1734],"class_list":["post-2652","post","type-post","status-publish","format-standard","hentry","category-customizations","category-dynamics-crm","tag-business-process-flow","tag-business-rules-in-dynamics-crm","tag-trigger-business-rules"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/2652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=2652"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/2652\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=2652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=2652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=2652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}