Creating and Troubleshooting Business Rules in Dynamics 365 CRM

Business Rules are a helpful tool in Dynamics 365 CRM applications that enable a power user or system administrator to modify or streamline the data entry experience for sales and service workers without having to do any coding or deep customization.

Although Business Rules are very powerful and easy to create, when problems occur they usually won’t provide an informative error message.

As a solution specialist at Encore, I have used Business Rules to help customers simplify form validation and automate field updates based on specific conditions. In this article, I’ll show you how to set up business rules for the most common needs I find among clients, and I’ll also give you some tips and tricks to avoid, identify, and solve common problems.

Table of Contents

Note: There are now 5 different Dynamics 365 apps that serve various CRM needs. In some contexts, you may also see those products referred to as “Customer Engagement” or “CE” apps. Business Rules work the same no matter which of those apps you’re using.

What Are Business Rules in D365 CRM?

Business Rules in Dynamics 365 CRM let you alter how certain Dynamics 365 fields work based on the data your users enter.

Business Rules can streamline data entry, reducing errors and speeding up your sales and service workers. This can be especially helpful if, for instance, you are experiencing higher turnover among staff or are launching a new product or service that your team may be unfamiliar with, and your system may not yet be optimized to handle.

With Business Rules, you can:

  • Set field values.
  • Lock or unlock a field.
  • Hide or show a field.
  • Make a field required or not required.

Example Use Cases for Business Rules

For instance, you can make Dynamics 365 automatically open a text field for your user to fill in whenever they select “other” for a field like “industry.”

Or let’s say you sell to manufacturers and to service companies, and you might have a field like “main product” for those manufacturers. You could have a Business Rule that disables the “main product” field when your salesperson selects that the account is a service company.

How to Set Business Rules in Dynamics 365 CRM

If you want to set a Business Rule in Dynamics 365 CRM, follow these steps.

Step 1. Navigate to the Form Editor

To start, open the form where you want to apply the Business Rule. In Dynamics 365 CRM, navigate to make.powerapps.com. From the left-hand navigation pane, select Tables under Dataverse, then choose the desired table (such as Leads, Contacts, or Opportunities). Once inside the table, click on the Forms tab, select the form you want to modify, and then choose Business Rules from the top toolbar to access or create new rules.

A screenshot showing three sections: Schema, Data experiences, and Customizations. Business rules is highlighted with a red box under the Customizations section.

Step 2. Access Business Rules

Once in the Business Rules section, click the + New Business Rules button, which you will find in the top toolbar. This will open the Business Rules window where you can create and manage rules for this entity.

Screenshot of Microsoft Power Apps showing the Objects section. A red box highlights the + New business rule button above a list of business rules for the Encore - Base UX table.

Tip: Make sure you are in the correct form before starting to avoid confusion, as changes to one form do not automatically apply to all forms for the entity.

Step 3: Create a New Business Rule

Click on New Business Rule to open the rule designer. From here, you can define the conditions and actions that will be triggered. For example, you might choose a condition like “If Crop Type equals ‘Corn,'” and then set an action to “Hide ‘clear film’ field.”

A user interface form with dropdown fields for Source, Field, Operator, Type, and Value. Crop Type is chosen, Equals is selected, and Corn is checked among crop options. A condition expression appears below.

Tip: Ensure that you click ‘Apply’ after defining each Condition or Action to save your work.

Step 4: Validate and Activate

After configuring your Conditions and Actions, click Validate to ensure there are no errors. If everything checks out, activate the rule by clicking the Activate button.

A computer interface showing a toolbar with Save and Validate buttons, with Validate highlighted by a red box. Below, tabs labeled Components and Properties are visible.

Tip: Do not forget to activate the rule; otherwise, it will not be applied to the form, and users will not see the changes.

Troubleshooting

One of the toughest issues with Business Rules is that when things go wrong, you may not get an error message that clearly describes the cause of the problem. Below is one common error message, and two common causes of problems that may not actually show an error.

“Field Required” Error Message

If you see an error message saying, “The value you entered is not valid for this field,” that may indicate that a business rule has been set on a field that’s not shown. To check on and solve this issue, you should review the business rules set on the entity, ensure the affected field is visible, and verify that the logic applies correctly across all relevant forms. If necessary, modify the business rule to avoid acting on hidden fields or ensure the field is conditionally shown when required.

Global Entity vs Form Business Rules

One of the most common problems with Business Rules is accidentally setting the rule globally for an entity, or only for a form, when you meant to do the opposite.

A global entity business rule will apply to all forms and processes for that entity across Dynamics 365 CRM. This is the right choice when you want consistent behavior for the entity regardless of the form or context the user is working in.

A form business rule, on the other hand, will only apply to a specific form for the entity. This is the best approach if you want to apply specific logic only to users working in a particular form or context without affecting other forms.

Now, if you’ve accidentally set the rule the wrong way, you might notice unexpected behavior across multiple forms (if it was intended for only one) or a lack of enforcement of the rule on some forms (if it was meant to be global). In that case, you can check if your Business Rule is set globally on an entity or just on a form by opening the Business Rule editor and looking at the scope setting, which will indicate whether the rule is set to “Entity” (global) or tied to a specific form.

Overlapping Business Rules

Another common cause of problems is that you may have two different Business Rules that both apply to a certain field. In that case, one or both rules may not function as you have expected.

For instance, you may have rules that set a field’s value automatically based on one condition and another rule that locks or disables the same field under different conditions.

A good way to check whether this is the cause of the problem is to review all the Business Rules for the entity and look specifically for rules that apply to the same field. You can then analyze the conditions and actions for each rule to identify conflicting logic, such as one rule trying to set a field while another disables it, which could prevent both from working as intended. Additionally, reviewing the execution order of the rules can help determine if one rule is overriding the other.

Get the Most from Dynamics 365 CRM

Business Rules are one of several automation options in Dynamics 365 CRM applications. Dynamics 365 is very flexible, and it will be most helpful to your company when it is fine-tuned to your specific needs, processes, and other business technologies.

If you’d like advice or assistance with Dynamics 365 specific to your situation, please feel free to contact us. We’d love to talk.

Suggested Articles: