{"id":966,"date":"2014-09-26T12:51:21","date_gmt":"2014-09-26T07:21:21","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=966"},"modified":"2014-09-26T12:51:21","modified_gmt":"2014-09-26T07:21:21","slug":"business-rule-updates-in-dynamics-crm-2015-part-ii","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2014\/09\/business-rule-updates-in-dynamics-crm-2015-part-ii\/","title":{"rendered":"Business Rule Updates in Dynamics CRM 2015 &#8211; Part II"},"content":{"rendered":"<p style=\"text-align: justify;\">In our <span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/www.inogic.com\/blog\/2014\/09\/business-rule-updates-in-dynamics-crm-2015\/\">previous blog<\/a><span style=\"color: #000000;\">,<\/span><\/span> we described the new features added in Business Rule in CRM 2015. We worked on new server side support in Business rule in detail. This blog will illustrate the new server side Business Rule in detail with the help of example.<\/p>\n<p style=\"text-align: justify;\">Suppose for example, we have a workflow which creates \u201c<strong>Contact<\/strong>\u201d for an \u201c<strong>Account<\/strong>\u201d every time a new \u201c<strong>Account<\/strong>\u201d is created and on the \u201c<strong>Contact<\/strong>\u201d entity we have activated a Business Rule which restricts us from entering \u201c<strong>Mumbai<\/strong>\u201d as the \u201c<strong>City<\/strong>\u201d of the \u201c<strong>Contact<\/strong>\u201d.<\/p>\n<p style=\"text-align: justify;\">In the above scenario if we\u00a0execute the workflow In CRM 2013, it will create the \u201c<strong>Contact<\/strong>\u201d and we\u00a0will get a warning on the \u201c<strong>City<\/strong>\u201d field only when we\u00a0open the \u201c<strong>Contact Form<\/strong>\u201d but in\u00a0CRM 2015 we have got this new feature of server side Business Rules which rolls back the message being fired on the parent entity if the Business Rule is violated at the child entity.<\/p>\n<p style=\"text-align: justify;\">In order to test this new feature of CRM 2015, we have to follow the below steps:<\/p>\n<ul style=\"text-align: justify;\">\n<li><strong>Step I: Create a workflow to create a Contact on creation of an Account:<\/strong><\/li>\n<\/ul>\n<p style=\"text-align: justify;\">We will create a Real-time workflow which creates a Contact on creation of an Account as shown below:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/15.jpg\"><img decoding=\"async\" class=\"alignnone wp-image-968 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/15.jpg\" alt=\"Real-time workflow creates Contact on creation of Account\" width=\"573\" height=\"517\" \/><\/a><\/p>\n<ul style=\"text-align: justify;\">\n<li><strong>Step II: Set the Scope of the Business Rule<\/strong><\/li>\n<\/ul>\n<p style=\"text-align: justify;\">The screenshot below shows how to set the scope of a Business rule and its value should be set to \u201c<strong>Entity<\/strong>\u201d to make business rule to run at server side:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/24.jpg\"><img decoding=\"async\" class=\"alignnone wp-image-969 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/24.jpg\" alt=\"Setting the Scope of Business Rule\" width=\"753\" height=\"107\" \/><\/a><\/p>\n<ul style=\"text-align: justify;\">\n<li><strong>Step III: Set the conditions and error message<\/strong><strong>\u00a0<\/strong><\/li>\n<\/ul>\n<p style=\"text-align: justify;\">Once the scope is set for the Business Rule, we set the conditions and message to be shown if the conditions are violated.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/33.jpg\"><img decoding=\"async\" class=\"alignnone wp-image-970 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/33.jpg\" alt=\"Conditions for the Business Rule\" width=\"421\" height=\"179\" \/><\/a><\/p>\n<ul style=\"text-align: justify;\">\n<li><strong>Step IV: Test the functionality<\/strong><\/li>\n<\/ul>\n<p style=\"text-align: justify;\">After setting the Scope of the Business Rule and activating it, we go on the \u201cAccount Form\u201d and try to create a new record with \u201cCity\u201d is \u201cMumbai\u201d as shown in the screenshot below:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/43.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-971\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/43.jpg\" alt=\"Account Form\" width=\"615\" height=\"305\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">And here we can see that neither the \u201c<strong>Account<\/strong>\u201d is created nor the \u201c<strong>Contact<\/strong>\u201d if we try to violate the Business Rule, as shown below:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/52.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-972\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/52.jpg\" alt=\"Error on Business Rule violation\" width=\"397\" height=\"189\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>Conclusion:<\/strong><\/p>\n<p style=\"text-align: justify;\">In the new version of CRM we observed that the server side Business Rule acts as plug-in\/workflows and it can rollback as a workflow\/plug-in if server side business rule throws an error.<\/p>\n<p style=\"text-align: justify;\">Hope this helps!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In our previous blog, we described the new features added in Business Rule in CRM 2015. We worked on new server side support in Business rule in detail. This blog will illustrate the new server side Business Rule in detail with the help of example. Suppose for example, we have a workflow which creates \u201cContact\u201d\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2014\/09\/business-rule-updates-in-dynamics-crm-2015-part-ii\/\">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":[22,23,24],"tags":[80,231,334,597,1578,1841],"class_list":["post-966","post","type-post","status-publish","format-standard","hentry","category-dynamics-crm-2015","category-dynamics-crm-2015-update-1","category-dynamics-crm-2016","tag-account","tag-business-rules","tag-contact","tag-dynamics-crm-2015","tag-server-side","tag-workflow"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/966","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=966"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/966\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}