Dynamics 365, Power Apps

Dynamics 365: Show Error Message with Business Rules

Posted by Heidi Neuhauser

Business rules are a powerful available to any Dynamics 365 System Administrator. They allow you to use a simple drag-and-drop interface to perform complex logic on a form. One intriguing option available using a business rule is to provide a recommendation to your users.

What does an Error Message look like in Dynamics 365?

When a specified condition has been met, an Error Message will display on the form. When a user hovers over the red x, it will display the error message:

Show Error Message

Configuring a Business Rule

Creating a business rule is very simple, provided that you have proper security permissions (System Administrator or System Customizer security roles). Start with a solution file in your Sandbox environment, navigate to the table where you’d like the Business rule to run. In these screen shots, I am using the Account table.

In that table, at the top, click on the Business rules header then select Add business rule in the top ribbon:

Add a new business rule from a solution file in Dynamics 365 Power Apps

This opens the Business Rules designer, which has a simple to use drag-and-drop interface. All Business Rules are triggered by a conditional, which you will see on your designer. Click into the Conditional box to set the conditions.

In this example, we have two rules that are looking for Est Appointment in less than 14 days where Estimated Revenue is blank:

Setting up a conditional in Dynamics 365 Power Apps to run our business rule.

Next, we need to add the Show Error Message action on our Canvas after our Conditional:

Action: Show Error Message

Show Error Message

When you add a Show Error Message action to the canvas, you will need to provide the following detail:

  • Display Name: A name for the design and label of this action in the Business Rule. This will not be displayed to a user.
  • Entity (this will default to the entity/table where you added the Business Rule)
  • Field: Select the field that triggers the Error Message after the condition has been met.
  • Message: This is the message that will be displayed when a user click on or hovers over the red x icon for an error.

Configure each of these fields to display the detail need. In this example, we have added the following information to our action:

Show Error Message details

When you have completed all actions you’d like added to your Show Error Message and Business Rule, you can Save & Activate it. Don’t forget to test in Sandbox!

Show Error Message

More Resources

Here is a link to Microsoft Documentation which will give you more detail on using Business Rules in Power Apps.

For a Business Rules 101 refresher, check out this article I wrote in 2020. It goes into things like setting scope, all available actions and the rules.

Learn more about Dynamics 365 by checking out my other blogs here.

Leave A Comment