Hello Guys,
In our previous blog we have seen what is polymorphic lookups and how to use them. Today I will be sharing tips to prepare you for interviews about Business rules.
Do follow us to know more about Dynamics and Power Platform. Also if you like our blog then please comment and share this blog with your friends.
Business Rules in Dynamics 365 help apply logic without code. They’re a common topic in interviews because they test both your functional and technical understanding. Let's see what questions can be asked by interviewers.
1. Can you explain what a Business Rule is in Dynamics 365 CRM and what advantages it offers?
Ans: A Business Rule in Dynamics 365 CRM is a declarative way to apply logic without writing code. It allows you to create simple conditions and actions that run either on forms (client-side) or on the server (server-side).
With Business Rules, you can:
- Show or hide fields
- Enable or disable fields
- Set default values
- Validate data
- Display error messages
- Copy data between fields
They are created using a drag-and-drop designer, making them easy to configure even for non-developers.
Advantages of Business Rules:
- No Code Required – Business users or functional consultants can apply logic without JavaScript or plugins.
- Consistency – Rules can run both on the client and server, ensuring consistent data validation.
- Time-Saving – Faster to configure compared to writing and deploying code.
- Maintainability – Easy to modify or extend without developer involvement.
- Reusability – One Business Rule can apply to multiple forms of the same entity.
- Improved Data Quality – Enforces validation and business logic to prevent incorrect data entry.
2. If multiple Business Rules are defined on a single entity, in what order will they execute?
If an entity has multiple Business Rules (BRs), the order of execution depends on the activation sequence.
Example: Suppose we have two Business Rules, BR1 and BR2. BR1 was created first, and BR2 was created later. If we activate BR2 before BR1, then BR2 will execute first, and BR1 will be executed later on.
3. If a single entity has both Business Rules and custom JavaScript, which one executes first?
The execution of logic in Dynamics 365 follows this sequence when an entity has a Business Rule, system JavaScript, and custom JavaScript:
- System JavaScript
- Custom JavaScript
- Business Rules
4. What are the main reasons a Business Rule may stop working at times?
One of the main reasons a Business Rule may stop working is when a field referenced in the rule is removed from the form.
Example: Consider an entity named Contact with three fields: First Name, Last Name, and Full Name. Suppose we create a Business Rule that checks if First Name and Last Name contain data, and then sets the Full Name accordingly. If the form where this rule is applied does not include First Name, Last Name, or Full Name, the Business Rule will not execute.
5. Can Business Rules be used to check the form type (Create or Update)? If yes, how?
Yes, we can use a Business Rule to check the Form Type. Every entity has a field called Created On, which stores the record creation date.
- When a new record is being created, this field is null.
- Once the record is saved, it contains a value.
So, in a Business Rule, we can use the “Contains Data” condition on the Created On field:
- If it is null, the form is in Create mode.
- If it has a value, the form is in Update mode.
6. What are the advantages of using Business Rules over JavaScript?
JavaScript triggers only on form events such as OnChange, OnLoad, and OnSave. For example, if records are created from the backend or imported into CRM, JavaScript will not execute.
In such cases, we can use a Business Rule with its scope set to Entity level. This ensures that the logic is applied regardless of how the record is created or updated.
This is one of the key advantages of Business Rules over JavaScript.
7. We have a requirement to display tooltip recommendations. How can this be achieved in Dynamics 365 CRM?
This can be achieved using a Business Rule in Dynamics 365 CRM.
Hope it helps...
Comments
Post a Comment