Business Rules in Dynamics 365, CRM 2013, CRM 2015 and CRM 2016 provide an interface for you to simply configure the ability to set field visibility. Let's walk through a brief example scenario so you can see just how easy it is for a System Administrator to use the drag and drop Business Rule canvas.
First, let's review the components of a business rule:
- Scope: Define scope of this Business Rule. Select from Entity, All Forms or specific forms.
- Condition: Define a new Condition. If X, then Y. If the condition is true, you will add actions to take. If the condition is false, you will add actions to take.
- Actions: 7 possible actions you can use in the Business Rule canvas.
- Show Message Error
- Set Field Value
- Set Default Value
- Set Business Required
- Set Visibility
During a recent focus group with our
- In a Solution file in your Sandbox, add a new Business Rule to the Leads Entity.
- At the top, enter a Business Rule Name and Description. Set Scope to Entity, since we want this rule to fire on all Leads, regardless of which form is used.
- Next, we will define our Conditional branch. Click the purple Condition box, then work in the Properties box on the left-hand side. Enter a Display Name, then create the Rules. For this example, we will select Field = Lead Type, Operator = Equals, Type = Value and Value = Residential. Click Apply at the bottom of the box.
- Now that we have defined our condition, we must add actions. Remember, the path along the top are the actions to take when the Condition is True. In this case, when Lead Type is Residential, the top path defines the actions taken. When the Conditional is False (in this example, when Lead Type = Commercial), the bottom path defines the actions taken. To add an Action, select the desired Action (Set Visibility for this example) click the box (circled below) and drag it onto the canvas in the appropriate path.
- When the Set Visibility action box is on the canvas, click the green box. Enter Display Name, select Field and change visibility from Yes to No where appropriate. Finally, click the blue Apply button at the bottom.
- Follow the same steps for the FALSE branch. Click the Components tab on the right-hand side to access Actions to drag and drop on the canvas.
- Repeat steps 4-6 until all fields have been included.
- Once complete, click the Activate button at the top.
Now that you have configured and activated your business rule, it's time to test! Go to a Lead, change Lead Type to Residential and verify that Company Name, Company Phone, Industry and SIC Code are not visible. Change Lead Type back to Commercial and verify that those fields are visible. Then, turn it over to your
Beringer Technology Group, a leading Microsoft Gold Certified Partner specializing in