Business Rules for Dynamics CRM (sometimes called Portable Business Logic or PBL) can be used to create rules at an Entity level. For this example we will discuss the difference between setting a field value in a business value vs. setting a default value. To begin, a business rule needs to be added. Follow the steps below:
1. To add a business rule, navigate to the form of the entity to which you would like to apply the rule.
2. Select Business Rules and click the New Business Rule button as you normally would to create a business rule.
3. Using business rules (PBL) you now have the option to set a default value. Setting a default value should be used when you want a field to appear with a set value on load. Being able to set a default value is a standard feature for option sets. Using the PBL Set default value feature allows you to set default values for numeric, text, and lookup fields as well. Set your condition and under actions select Set default value.
4. When you select default value you will be able select the field, type, and value to be input under the ACTION section. Here the default value for the credit limit field is being set to $10,000.
5. Now, for every new account that is created, $10,000.00 will be the starting value for the credit limit field on the form.
Business rules (PBL) also allow you to use the Set field value. This should be used when you want to apply logic and don’t need to have a field set on the form load. For example under the company profile section, logic might be needed to fill in a field saying if a SIC Cod begins with 0 set the Industry field to Agriculture and the ownership to Private. This can be done using the following steps with Set field value:
1. Set the condition that is required for the field value to be set and under the ACTION section, select Set field value.
2. When you select set field value you will be able select the field, type, and value to be input under the ACTION section. Here the field values for Industry and Ownership are being set
3. When this is activated, within the account form, when the condition is met, here being an SIC code entered beginning with a zero and saved, the Industry and Ownership fields will be populated.
That is the difference between using Set default value and Set field value in business rules! For more on business rule you can visit our main PowerObjects Dynamics CRM blog, or check out a few individual business process flow related blogs below:
- Dynamics CRM 2015 to Feature Enriched Business Process Flows
- How to Turn On Ready-to-Use Business Process Flows in Dynamics CRM 2013