In Dynamics 365 CRM or Power Platform, Business rules provide a simple interface to implement and maintain fast-changing and commonly used rules to set and clear field values,set field requirement levels,show or hide fields ,Enable or Disable fields,validate and show error messages Every business rule will have components and properties. And every component will have Actions and Flow[Condition]. Every business rule starts with a condition. In this article we are going to see about 2 Actions Set Business Required and Visibility with a business scenario on contact entity
Login to the required Dynamics CRM/ Power Apps environment using URL make.powerapps.com by providing user name and password as shown in the below figure.
Create a solution with the required entity/table to create a business rule , if you want to know about how to create a solution , you can refer here and select the solution as shown in the below figure.
Open ContactCustomiazations solution and click on entity/table contact as shown in the below figure.
After Step 3, go to contact entity/table and then create below custom (user defined)columns as shown in the below figure.
After Step 4, click on Business rules and then click on Add business rule as shown in the below figure.
After Step 5, a new tab gets opened, provide Business rule name and relevant Description and keep Scope as Entity by default and click on save as shown in the below figure.
After Step 6, you will encounter validation Failed! shown in the below figure.
After Step 7, Provide Condition Name and select field Birthday custom field and operator Contains Data and click on Apply shown in the below figure.
After Step 8, still we see 1 validation error . Now we have to provide 2 Business Required Actions from Actions Section and have to drag and drop Action and give it to true and false part of Condition and provide values as shown in the right side of the window and click on Apply you should see validation error goes off as shown in the below figure.
After Step 9, now take another Action Set Visibility and then drag and drop to the right side of Set Business Required If Birthday have Value as shown in the below figure.
After Step 10, as 1 validation failed error is shown at the top and another at the top of Set Visibility New Action, click on Set Visibility Action and provide field Discount and give Visible value as Yes and click on Apply as shown in the below figure.
After Step 11, provide Set Visibility Action to both Set Business Required Actions in Step 9 and click on Apply you could see validation successful message as well as shown in the below figure.
After Step 12,click on Save Button and click on Activate button of Business Rule window and and close it and go to solution and publish it as shown in the below figure.
After Step 13,open new contact record and select Information form from Contact Dropdown and set Birthdate and see Vaccination Field as required Field and Discount field will be also shown as shown in the below figure.
After Step 14,in the same way if we make Birthday Field as empty, then Vaccination field will become not Business Required or non Mandatory and Discount field get’s hidden as shown in the below figure.
- Please make sure you keep the required fields on Contact Form.
- Select fields for Actions as well as for Conditions without fail.
- Make sure to Activate Business Rule after save.
- Publish all changes without fail.
- Give name of conditions and Actions names in a meaningful way.
Conclusion: In this way one can easily perform commonly used Business rules with Set Business Required and Visibility Actions in few minutes can be built.