You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: powerapps-docs/maker/model-driven-apps/create-business-rules-recommendations-apply-logic-form.md
+50-44Lines changed: 50 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: "Create model-driven app business rules and recommendations | MicrosoftDocs"
3
3
description: Learn how to create a business rule for a specific form in Power Apps
4
4
ms.custom: ""
5
-
ms.date: 06/15/2022
5
+
ms.date: 09/10/2024
6
6
ms.reviewer: ""
7
7
ms.suite: ""
8
8
ms.tgt_pltfrm: ""
@@ -14,6 +14,7 @@ applies_to:
14
14
ms.assetid: 00e62904-2ce9-4730-a113-02b1fedbf22e
15
15
caps.latest.revision: 31
16
16
author: "Mattp123"
17
+
contributors: anshuman-ms
17
18
ms.subservice: mda-maker
18
19
ms.author: "matp"
19
20
tags:
@@ -23,7 +24,7 @@ search.audienceType:
23
24
---
24
25
# Create business rules to apply logic in a model-driven app form
25
26
26
-
Very often it is necessary to add in business logic to ensure that columns in a model-driven app are shown, hidden, or set with the correct values.
27
+
Very often it's necessary to add in business logic to ensure that columns in a model-driven app are shown, hidden, or set with the correct values.
27
28
28
29
This article shows how to create [business rules](model-driven-app-glossary.md#business-rule) and recommendations to apply form logic in a model-driven app without writing JavaScript code or creating plug-ins. Business rules provide a simple interface to implement and maintain fast-changing and commonly used rules. They can be applied to main and quick create forms. Business rules work in model-driven apps, legacy web apps, Dynamics 365 for tablets, and Dynamics 365 for Outlook (online or offline mode).
29
30
@@ -48,17 +49,15 @@ By combining conditions and actions, the following actions are possible with bus
48
49
>
49
50
> Business rules don’t work with multi-select choices.
50
51
51
-
## View, edit or create a business rule in Power Apps
52
+
## View, edit, or create a business rule in Power Apps
52
53
53
-
1. Sign in to [Power Apps](https://make.powerapps.com/?utm_source=padocs&utm_medium=linkinadoc&utm_campaign=referralsfromdoc).
54
+
1. Sign in to [Power Apps](https://make.powerapps.com/?utm_source=padocs&utm_medium=linkinadoc&utm_campaign=referralsfromdoc).
55
+
1. Select **Solutions** on the left navigation pane, open the solution you want, and then open or add the table you want.
56
+
1. Select **New**, and then under **Customizations**, select **Business rule**. [!INCLUDE [left-navigation-pane](../../includes/left-navigation-pane.md)]
54
57
55
-
2. Select **Tables** on the left navigation pane, open the table you want, and then under the **Customizations** area, select **Business rules**. [!INCLUDE [left-navigation-pane](../../includes/left-navigation-pane.md)]
56
-
> [!note]
57
-
> Customizations to a table take should place within a [solution](../model-driven-apps/model-driven-app-glossary.md#solution). To update a table within a solution, open your solution, and then open the table. Then, under the **Customizations** area, select **Business rules**.
58
+
The business rules designer opens. Next step: [Set the business rule properties](#set-the-business-rule-properties)
58
59
59
-
3. On the command bar, select **New business rule**.
60
-
61
-
## View, edit or create a business rule in form designer
60
+
## View, edit, or create a business rule in form designer
62
61
63
62
1. On form designer left navigation pane, select **Business rules**.
64
63
@@ -75,9 +74,10 @@ When the business rule designer window opens for a new rule, a single condition
Enter or select the following properties from the business rule command bar.
77
+
78
78
1.**Business rule name**: By default, the rule is named *New business rule*. We recommend you enter a meaningful name for the business rule.
79
79
1.**Description**: Optionally, add a description.
80
-
1.**Scope**: The scope of the business rule determines which forms the business rule will be applied. You set the scope, according to the following:
80
+
1.**Scope**: The scope of the business rule determines which forms the business rule will be applied. You set the scope, according to these options:
81
81
82
82
:::row:::
83
83
:::row-end:::
@@ -121,107 +121,113 @@ Enter or select the following properties from the business rule command bar.
121
121
122
122
1.**Add conditions.** To add more conditions to your business rule:
123
123
124
-
1.Drag the **Condition** component from the **Components** tab to a plus sign in the designer.
124
+
1. Drag the **Condition** component from the **Components** tab to a plus sign in the designer.
125
125
126
126

127
127
128
-
2.To set properties for the condition, select the **Condition** component in the designer window, and then set the properties in the **Properties** tab on the right side of the screen. As properties are set, an expression is created at the bottom of the **Properties** tab.
128
+
2. To set properties for the condition, select the **Condition** component in the designer window, and then set the properties in the **Properties** tab on the right side of the screen. As properties are set, an expression is created at the bottom of the **Properties** tab.
129
129
130
-
3.To add an additional clause (an AND or OR) to the condition, select **New** in the **Properties** tab to create a new rule, and then set the properties for that rule. In the **Rule Logic** column, you can specify whether to add the new rule as an AND or an OR.
130
+
3. To add an additional clause (an AND or OR) to the condition, select **New** in the **Properties** tab to create a new rule, and then set the properties for that rule. In the **Rule Logic** column, you can specify whether to add the new rule as an AND or an OR.
131
131
132
132

133
133
134
-
4.Once finished setting properties for the condition, select **Apply**.
134
+
4. Once finished setting properties for the condition, select **Apply**.
135
135
136
-
4.**Add actions.** To add an action:
136
+
2.**Add actions.** To add an action:
137
137
138
-
1. Drag one of the action components from the **Components** tab to a plus sign next to **Condition** component. Drag the action to a plus sign next to a check mark if you want the business rule to take that action when the condition is met, or to a plus sign next to an x if you want the business rule to take that action if the condition is not met.
138
+
1. Drag one of the action components from the **Components** tab to a plus sign next to **Condition** component. Drag the action to a plus sign next to a check mark if you want the business rule to take that action when the condition is met, or to a plus sign next to an x if you want the business rule to take that action if the condition isn't met.
139
139
140
140

141
141
142
142
2. To set properties for the action, select the **Action** component in the designer window, and then set the properties in the **Properties** tab.
143
143
144
144
3. When finished setting properties, select **Apply**.
145
145
146
-
5.**Add a business recommendation.** To add a business recommendation:
146
+
3.**Add a business recommendation.** To add a business recommendation:
147
147
148
-
1.Drag the **Recommendation** component from the **Components** tab to a plus sign next to a **Condition** component. Drag the **Recommendation** component to a plus sign next to a check mark if you want the business rule to take that action when the condition is met, or to a plus sign next to an x if you want the business rule to take that action if the condition is not met.
148
+
1. Drag the **Recommendation** component from the **Components** tab to a plus sign next to a **Condition** component. Drag the **Recommendation** component to a plus sign next to a check mark if you want the business rule to take that action when the condition is met, or to a plus sign next to an x if you want the business rule to take that action if the condition isn't met.
149
149
150
-
2.To set properties for the recommendation, select the **Recommendation** component in the designer window, and then set the properties in the **Properties** tab.
150
+
2. To set properties for the recommendation, select the **Recommendation** component in the designer window, and then set the properties in the **Properties** tab.
151
151
152
-
3.To add more actions to the recommendation, drag them from the **Components** tab, and then set properties for each action in the **Properties** tab.
152
+
3. To add more actions to the recommendation, drag them from the **Components** tab, and then set properties for each action in the **Properties** tab.
153
153
154
-
> [!NOTE]
155
-
> When you create a recommendation, a single action is added by default. To see all the actions in a recommendation, select **Details** on the **Recommendation** component.
154
+
> [!NOTE]
155
+
> When you create a recommendation, a single action is added by default. To see all the actions in a recommendation, select **Details** on the **Recommendation** component.
4. When you're finished setting properties, select **Apply**.
158
158
159
-
6. To validate the business rule, select **Validate** on the action bar.
159
+
4. To validate the business rule, select **Validate** on the action bar.
160
160
161
-
7. To save the business rule, select **Save** on the action bar.
161
+
5. To save the business rule, select **Save** on the action bar.
162
162
163
-
8.To activate the business rule, select it in the Solution Explorer window, and then select **Activate**. It is not possible to activate the business rule from the designer window.
163
+
6.To activate the business rule, select it in the Solution Explorer window, and then select **Activate**. It isn't possible to activate the business rule from the designer window.
164
164
165
165
> [!TIP]
166
-
> Here are a few tips to keep in mind as you work on business rules in the designer window:
167
-
>
168
-
> - To take a snapshot of everything in the Business Rule window, select **Snapshot** on the action bar. This is useful, for example, when getting feedback from team members.
166
+
> Here are a few tips to keep in mind as you work on business rules in the designer window:
167
+
>
168
+
> - To take a snapshot of everything in the **Business Rule** window, select **Snapshot** on the action bar. This is useful, for example, when getting feedback from team members.
169
169
> - Use the mini-map to navigate quickly to different parts of the process. This is useful when working on a complicated process that scrolls off the screen.
170
170
> - As you add conditions, actions, and business recommendations to your business rule, code for the business rule is built and appears at the bottom of the designer window. This code is read-only.
171
171
172
-
<aname="BKMK_LocalizingErrorMessages"></a>
173
172
## Localize error messages used in business rules
174
173
175
-
If more than one language is provisioned for your environment, it is worth localizing any error messages that have been set. Each time a message is set, a label is generated by the system. If the translations in your environment are set, localized versions of your messages can be added and then imported back into the system. This enables people using languages other than your base language to view the translated messages.
174
+
If more than one language is provisioned for your environment, it's worth localizing any error messages that are set. Each time a message is set, a label is generated by the system. If the translations in your environment are set, localized versions of your messages can be added and then imported back into the system. This enables people using languages other than your base language to view the translated messages.
176
175
177
176
## Common issues
178
177
179
-
This section describes common issues that may occur when you use business rules.
178
+
This section describes common issues that might occur when you use business rules.
180
179
181
180
### Full Name column and Address column not supported with Unified Interface apps
182
181
183
-
Actions or conditions that use a composite column like the **Full Name**(fullname) column or an **Address** column aren't supported in apps based on Unified Interface. Alternatively, you can use actions or conditions with the constituent columns. For example, for the **Full Name** column, you can use actions or conditions on the **First Name** (firstname) and **Last Name** (lastname) columns.
182
+
Actions or conditions that use a composite column like the **Full Name**`fullname` column or an **Address** column aren't supported in apps based on Unified Interface. Alternatively, you can use actions or conditions with the constituent columns. For example, for the **Full Name** column, you can use actions or conditions on the **First Name** (firstname) and **Last Name** (lastname) columns.
184
183
185
184
### Business rules don't execute for some users
186
185
187
186
Make sure that users have a security role that includes, at a minimum, user scope read privileges on the Process table. By default, the Basic User security role has this privilege.
188
187
189
188
### Business rules don't fire on editable grid on a dashboard
190
189
191
-
Entity scoped business rules will not fire on an editable grid when the editable grid is configured on a dashboard page.
190
+
Entity scoped business rules won't fire on an editable grid when the editable grid is configured on a dashboard page.
192
191
193
192
### Is the business rule not firing for a form?
194
193
195
-
A business rule may not execute because the column referenced in the business rule isn't included with the form.
194
+
A business rule might not execute because the column referenced in the business rule isn't included with the form.
195
+
196
196
1. Open solution explorer. Expand the table that you want, and then select **Forms**.
197
-
2. Open the form, and then on the form designer ribbon select **Business Rules**.
198
-
3. In the form designer, open the business rule.
199
-
4. In the business rule designer, select each condition and action to verify all the columns referenced in each condition and action.
197
+
1. Open the form, and then on the form designer ribbon select **Business Rules**.
198
+
1. In the form designer, open the business rule.
199
+
1. In the business rule designer, select each condition and action to verify all the columns referenced in each condition and action.
200
200
201
201
> [!div class="mx-imgBorder"]
202
202
> 
203
203
204
-
5. Verify that each column referenced in the business rule is also included on the form. If not, add the missing column to the form.
204
+
1. Verify that each column referenced in the business rule is also included on the form. If not, add the missing column to the form.
205
205
206
206
> [!div class="mx-imgBorder"]
207
207
> 
208
208
209
-
A business rule may also not execute because a column referenced in the business rule is a composite column. The constituent columns of the composite column can be used instead.
209
+
A business rule might also not execute because a column referenced in the business rule is a composite column. The constituent columns of the composite column can be used instead.
210
+
211
+
### Unsupported column types
212
+
213
+
Columns of type unique identifier and rollup columns aren't supported with business rules.
214
+
215
+
There are a few special columns which support localizable values, such as the **Name** column for the **Product** table that's included with Dynamics 365 for Sales apps. Columns that support localizable values aren't supported with business rules.
210
216
211
217
## Frequently asked questions (FAQ)
212
218
213
219
*Can business rules unlock columns on a read-only form?*
214
220
- Yes, a business rule can unlock columns and edit actions on a read-only form.
215
221
216
222
*How do I troubleshoot a business rule that isn't working?*
217
-
- See [Is your business rule not firing for a form?](create-business-rules-recommendations-apply-logic-form.md#is-the-business-rule-not-firing-for-a-form) in this topic.
223
+
- See [Is your business rule not firing for a form?](create-business-rules-recommendations-apply-logic-form.md#is-the-business-rule-not-firing-for-a-form) in this article.
218
224
219
225
*What do recommendations look like within a form?*
220
226
221
-
Recommendations show a lightbulb next to the column label.
227
+
Recommendations show a light bulb next to the column label.
0 commit comments