Dynamics 365 Instance NORMALITY Backup and Restore of Dynamics 365 Instances Update your Dynamics 365! Creating a Dynamics 365 Process Basic operation of Dynamics 365 processes Using Dynamics 365 business rules Managing Dynamics 365 Entities Using Dynamics 365 Calculated Fields Managing a Dynamics 365 Instance Customization of Dynamics 365 entities and option sets Customize Dynamics 365 web resources and processes Recommended third-party solutions Countermeasures against infinite loops in workflow processes Changes to the method of applying major updates [2019.08] Adjust the sitemap in the settings
2017.08.23 | maintaining-dynamics-365/

Using Dynamics 365 business rules

Author:Takafumi Noguchi

linkedIn

Dynamics 365 has a feature called Business Rules. Normally, Javascript implementation is required to hide fields or perform operations according to conditions on a form. However, this feature eliminates the need for script implementation and allows users to easily set up the rules required for their business.

The following can be achieved with business rules.

By combining conditions and actions, business rules can be used to perform the following operations

  • Set the field value
  • Clearing field values
  • Setting the input request level for a field
  • Show or hide fields
  • Validate the data to enable or disable the field and display an error message.
  • Creating Business Recommendations Based on Business Intelligence

Quotes: Create business rules and business recommendations to apply logic to forms.

In this section, we will use the business rules to perform simple operations.

Create business rules.

Go to “Settings”, “Customize”, and then click “Customize System”.

Expand “Trading Partner Companies” from the entities and click “Forms”. Open the form to which you want to apply the business rule.

Click “Business Rules” in the menu.

In the lower right corner, you will see a button that says “Add new business rule”, click it. Then the editor will be displayed. Here, we will perform the necessary operations.

As shown in the figure below, there is an area called “component” where you can lock or hide fields, display error messages, etc., and perform actions according to the conditions.

First, we will set up the conditions. Click on the condition component to open the “Properties” on the right side, and add the “Display Name” and “Rule”. In this case, we will use the following conditions.

Display nameEnter basic company information
Rule 1Email is blank
Rule 2Web site is blank
Rules Logicand

To add a rule, click “+ New”. When you are done with the settings, click the “Apply” button.

We now have a new condition. Now we will display an error message when the condition is TRUE. Drag and drop “Show Error Message” from “Components” to the right side of the condition component.

Configure the settings as follows.

Display nameerror indication
fieldWeb Site
MessageLook up the company information and enter it

Once you have configured the settings, click “Apply”.

You have now created a business rule. Click “Save” to verify that there are no problems with the rule. If no problems are detected, click “Activate”.

Return to the Form Editor, save and “publish” the customization.

Now let’s see if the business rules have been applied.

You see an error message in the field called “Web site”.

Use business rules for other forms.

What if you want to use the business rules you created above in other forms with the same conditions? Let’s set the scope of the business rule.

Open the business rule and click “Deactivate” to make it editable. Check the “Scope” in the upper right corner. The scope can be set as follows.

entityAll forms and servers
All formsAll forms
Specific form nameOnly specified forms

If you want to apply it to all forms, select “All forms”.

If you want to make a limited setting of only two forms instead of all forms, duplicate this business rule once using “Save as…”.

The business rule will be duplicated, so you can change the scope there and delete the “Copy XX” part of the display name and save it to achieve this. Now, click “Activate” to complete the settings so that the same business rule will be activated in another form.

*The original business rule is still inactive, so please “activate” it as well.

Using Recommendations

There is a component called “Recommendation” in the business rules. This is a suggestion type component, where the user is presented with a recommended value, and if it is OK, it is applied.

For example, create a recommendation like the following

Business rule name: Use Recommendations

conditions

Display nameDescription is blank
fieldDescription
operatoris blank

 

recommendation

Recommendation NameTest Recommendation
fieldDescription
TitleDescription is blank.
DetailsIf the description is blank, write “None”.

 

Action.

Display nameTest Action
fieldDescription.
valueNone

The conditions are set as follows.

Add a recommendation from the component and drag and drop it to the right of the condition. Then, configure the recommendation settings and click “Apply”.

Let’s set up the actions in the recommendations as follows.

Save the file, activate it, and publish it. Let’s take a look at the result. If you look at the field, you will see the i mark for recommendation, and if you click on it, it will be as you created it.

Clicking the “Apply” button will execute the action and add the value “None” to the description.

Business rules can also be used for various other purposes, such as locking a field to prevent it from being edited, hiding it, or copying the value of another field. Please try to use them.

Dynamics 365 Blog / maintaining-dynamics-365 /use-business-rules

Those who read this article have read other articles like this.

Popular articles