- January 25, 2019
- Posted by: Taylor Johnson
- Category: Customizations
From time to time, as Users are editing forms, we might want immediate feedback to help guide them. This can be useful for many different reasons.
Ex. 1 Making mandatory fields.
Ex. 2 Populate error messages.
Ex. 3 Set default values to fields.
Ex. 4 Hide and show fields.
Ex. 5 Lock and unlock fields.
Ex. 6 Giving a recommendation to a user.
These can all be satisfied with Business Rule implementations. A few years ago, none of this could be done without writing custom JavaScript. Business rules allow admins to bridge the gap and act as a developer without writing a single line of code. There is still a lot of use when it comes to knowing how to use JavaScript. For example, your client wants you to hide a section or tab from a Form. You can either do this by individually hiding all the F
Business Rules are different from Workflows in that Business Rules happen as fields are changed on forms. Business Rules give immediate feedback, which helps correct user behavior as they interact with F
Business Rules are triggered when a record is opened, or a field is changed.
Warning: All Business Rule Fields must be in the Form or the Business Rule won’t perform.
Rule Designer
The Rule Designer is an easy-to-use, Drag/Drop interface.
Conditions
If/else conditions
- Allows creation of alternate condition if first, if, is not met.
- Limit of 10 if/else conditions
Otherwise
- If not
And or “or”
- Used to group separate statements
Actions
Actions are what we want to be performed with a Business Rule. Below are the different actions that can be performed, along with an image of what they look like in the Rule D
- Recommendation
- Show error message
- Set field value
- Set business required
- Set visibility
- Set default value
- Lock or unlock field
Business Rule Scope
Entity — All Forms and server
All Forms — All forms
Specific Forms — Just that Form
Activation, Validation, and publishing solution
When finished with your Business Rule, be sure to activate it.
If there is anything wrong with the Business Rule it should be displayed in red. If using a Business Rule inside of a Solution, make sure that the Solution is published.
You have probably seen Business R
I quickly created a Business Rule to show how easy it is to do. This took me about three minutes to create. In my Business rule, I wanted to make the “Street 1” to be a required field.
I made the condition that
- IF the relationship type is equal to “Customer”
- THEN Set Address 1 as Business Required.
- Else Set Address 1 as Not Business Required.
As you can see below, there is now a red star above the “Street 1.” Success!
The definitions are based on the Microsoft Dynamics 365 website. I encourage you to look at them. These documents are helpful when you want to learn more in-depth on any subject.