Saturday, April 23, 2016

Show Business Process Error By Using Workflow (No Code) - Dynamics CRM 2015/2016




Dynamics CRM 2015/2016 (Online & On-premises) Business Rules has been improved with the following features: 

  • Enriched business logic with- If..Else If..Else logic support
  • Ability to combine expressions using And/Or
  • Support for setting default values on the record.
  • Business Rules can now be executed on the server side.
In Dynamics CRM 2015/2016 (Online & On-premises), the scope now can be set to all forms, a specific form and the new option “Entity”:




If Business Rule is created with scope as “Entity” then the business rules will execute server side. This means that business rule also can be executed when you do updates to a record by Workflows or Plugins. 

Now I will show you a quick sample for showing Business Process Error by using business rules and workflow:

First we will be needed to add a new field on the entity, in this sample I have created a new tow options field which is called Show Message with default value "No":



Then I have created a business rule for checking the value of the field Show Message with scope as "Entity", If the field value is "Yes", then show the error message "The Amount Is less than 0!" against field Show Message :





Then create a real-time workflow for checking the value of any field, in this sample I created real-time workflow to check if the Amount is less than 0.  



Then I added two steps, one for checking the amount of Amount field if less than 0, If Yes then the other step is to set Show Message field to "Yes"







Now if I create a record with an amount which is less than 0 on the Amount field, I will get the following :

Also you can use this trick in any related Entities :)


Hope it helps!


Unexpected Error When Replying or Forwarding an Email

Recently came across an interesting issue from one of my clients, they were working fine since around 2 years ago with no issues, using Dyn...