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/developer/model-driven-apps/define-ribbon-enable-rules.md
+58-32Lines changed: 58 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,17 @@
2
2
title: "Define ribbon enable rules (model-driven apps) | Microsoft Docs"# Intent and product brand in a unique string of 43-59 chars including spaces"
3
3
description: "Learn about defining specific rules to control when the ribbon elements are enabled during configuration of ribbon elements."# 115-145 characters including spaces. This abstract displays in the search result."
4
4
keywords: ""
5
-
ms.date: 10/31/2018
5
+
ms.date: 02/08/2019
6
6
ms.service:
7
7
- "powerapps"
8
8
ms.custom:
9
9
- ""
10
10
ms.topic: article
11
11
ms.assetid: 201f5db9-be65-7c3b-8202-822d78338bd6
12
-
author: JimDaly # GitHub ID
13
-
ms.author: jdaly # MSFT alias of Microsoft employees only
14
-
manager: shilpas # MSFT alias of manager or PM counterpart
When configuring Ribbon elements you can define specific rules to control when the ribbon elements are enabled. The `<EnableRule>` element is used as follows:
28
26
29
27
- Use the `/RuleDefinitions/EnableRules/EnableRule` element to define rules controlling when the ribbon element should be enabled.
@@ -48,9 +46,9 @@ When configuring Ribbon elements you can define specific rules to control when t
|`Modern`| The command bar is presented using Dynamics 365 for tablets. |
49
+
|`Modern`| The command bar is presented using [!INCLUDE[pn_moca_full](../../includes/pn-moca-full.md)]. |
52
50
|`Refresh`| The command bar is presented using the updated user interface. |
53
-
|`Legacy`| The ribbon is presented in forms for entities that were not updated or in a list view in Dynamics 365 for Outlook. |
51
+
|`Legacy`| The ribbon is presented in forms for entities that were not updated or in a list view in [!INCLUDE[pn_crm_for_outlook_full](../../includes/pn-crm-for-outlook-full.md)]. |
54
52
55
53
### Crm Client Type Rule
56
54
Uses the `<CrmClientTypeRule>` element to allow definition of rules depending on the type of client used. Type options are as follows:
@@ -60,27 +58,64 @@ Uses the `<CrmClientTypeRule>` element to allow definition of rules depending o
60
58
-`Outlook`
61
59
62
60
### Crm Offline Access State Rule
63
-
Uses the `<CrmOfflineAccessStateRule>` element. Use this criteria to enable a ribbon element based on whether Dynamics 365 for Microsoft Office Outlook with Offline Access is currently offline.
61
+
Uses the `<CrmOfflineAccessStateRule>` element. Use this criteria to enable a ribbon element based on whether [!INCLUDE[pn_crm_outlook_offline_access](../../includes/pn-crm-outlook-offline-access.md)] is currently offline.
64
62
65
63
### Crm Outlook Client Type Rule
66
-
Uses the `<CrmOutlookClientTypeRule>` element. Use this rule if you want to only display a button for a specific type of Dynamics 365 for Outlook. Type options are as follows:
64
+
Uses the `<CrmOutlookClientTypeRule>` element. Use this rule if you want to only display a button for a specific type of [!INCLUDE[pn_crm_for_outlook_full](../../includes/pn-crm-for-outlook-full.md)]. Type options are as follows:
67
65
68
66
-`CrmForOutlook`
69
67
70
68
-`CrmForOutlookOfflineAccess`
71
69
72
70
### Custom Rule
73
-
Uses the `<CustomRule>` element. Use this kind of rule to call a function in a JavaScript Library that returns a Boolean value.
71
+
Uses the `<CustomRule>` element. Use this kind of rule to call a function in a JavaScript library that returns a Promise (Unified Interface) or boolean (Unified Interface and web client).
> Custom rules that do not return a value quickly can affect the performance of the ribbon. If you have to perform logic that might take some time to complete, use the following strategy to make your custom rule asynchronous:
77
-
>
78
-
> 1. Define a rule that checks for a custom object. You might check for an object such as `Window.ContosoCustomObject.RuleIsTrue` that you just attach to the Window.
79
-
> 2. If that object exists, return it.
80
-
> 3. If that object does not exist, define the object and set the value as false.
81
-
> 4. Before you return a value, use [settimeout](https://msdn.microsoft.com/library/ms536753\(VS.85\).aspx)<!-- TODO not sure about this link--> to execute an asynchronous callback function to re-set the object. Then return false.
82
-
> 5. After the callback function has performed the operations that are required to determine the correct result, it sets the value of the object and uses the `refreshRibbon` method to refresh the ribbon.
83
-
> 6. When the ribbon is refreshed, it detects the object together with the accurate value set and the rule is evaluated.
82
+
> Custom rules that do not return a value quickly can affect the performance of the ribbon. If you have to perform logic that might take some time to complete (for example, a network request), use the following strategy to make your custom rule asynchronous.
83
+
84
+
Unified Interface rules support returning a Promise rather than boolean for asynchronous rule evaluation. If the promise does not resolve within 10 seconds, the rule will resolve with a false value.
85
+
> [!NOTE]
86
+
> Promises-based rules will only work on Unified Interface, so they cannot be used if classic Web Client is still being used.
87
+
```JavaScript
88
+
functionEnableRule()
89
+
{
90
+
constrequest=newXMLHttpRequest();
91
+
request.open('GET', '/bar/foo');
92
+
93
+
returnnewPromise((resolve, reject) =>
94
+
{
95
+
request.onload=function (e)
96
+
{
97
+
if (request.readyState===4)
98
+
{
99
+
if (request.status===200)
100
+
{
101
+
resolve(request.responseText==="true");
102
+
}
103
+
else
104
+
{
105
+
reject(request.statusText);
106
+
}
107
+
}
108
+
};
109
+
request.onerror=function (e)
110
+
{
111
+
reject(request.statusText);
112
+
};
113
+
114
+
request.send(null);
115
+
});
116
+
}
117
+
```
118
+
84
119
85
120
### Entity Rule
86
121
Uses the `<EntityRule>` element. Entity rules allow for evaluation of the current entity. This is useful when you define custom actions that apply to the Entity Template instead of for specific entities. For example, you may want to add a ribbon element to all entities except for several specific entities. It is easier to define the custom action for the Entity Template that applies to all entities and then use an Entity Rule to filter out those that should be excluded.
@@ -104,10 +139,10 @@ Uses the `<CrmClientTypeRule>` element to allow definition of rules depending o
104
139
Uses the `<OrRule>` element. The `OrRule` lets you override the default AND comparison for multiple enable rule types. Use the `OrRule` element to define several possible valid combinations to check.
105
140
106
141
### Outlook Item Tracking Rule
107
-
Uses the `<OutlookItemTrackingRule>` element. Use the `TrackedInCrm` attribute for this element to determine whether the record is being tracked in Common Data Service for Apps.
142
+
Uses the `<OutlookItemTrackingRule>` element. Use the `TrackedInCrm` attribute for this element to determine whether the record is being tracked in PowerApps.
108
143
109
144
### Outlook Version Rule
110
-
Uses the `<OutlookVersionRule>` element. Use this to enable a ribbon element for a specific version of Office Outlook as follows:
145
+
Uses the `<OutlookVersionRule>` element. Use this to enable a ribbon element for a specific version of [!INCLUDE[pn_MS_Outlook_Full](../../includes/pn-ms-outlook-full.md)] as follows:
111
146
112
147
-`2003`
113
148
@@ -124,17 +159,8 @@ Uses the `<CrmClientTypeRule>` element to allow definition of rules depending o
124
159
### Selection Count Rule
125
160
Uses the `<SelectionCountRule>` element. Use this kind of rule with a ribbon displayed for a list to enable a button when specific maximum and minimum numbers of records in the grid are selected. For example, if your button merges records, you should make sure at least two records are selected before enabling the ribbon control.
126
161
127
-
### Sku Rule
128
-
Uses the `<SkuRule>` element. Use this kind of rule to enable a ribbon element for a specific SKU version of Dynamics 365 as follows:
129
-
130
-
-`OnPremise`
131
-
132
-
-`Online`
133
-
134
-
-`Spla`
135
-
136
162
### Value Rule
137
-
Uses the `<ValueRule>` element. Use this rule to check the value of a specific field in the record being displayed in the form. You must specify the `Field` and the `Value` to check.
163
+
Uses the `<ValueRule>` element. Use this rule to check the value of a specific field in the record being displayed in the form. You must specify the `Field` and the `Value` to check.
138
164
139
165
### See also
140
166
[Customize commands and the ribbon](customize-commands-ribbon.md)
Copy file name to clipboardExpand all lines: powerapps-docs/maker/common-data-service/create-edit-fields.md
+22-13Lines changed: 22 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "How to create and edit fields for Common Data Service for Apps| MicrosoftDocs"
3
3
ms.custom: ""
4
-
ms.date: 05/18/2018
4
+
ms.date: 02/08/2019
5
5
ms.reviewer: ""
6
6
ms.service: "crm-online"
7
7
ms.suite: ""
@@ -14,7 +14,7 @@ applies_to:
14
14
ms.assetid: d88677fa-2caf-47b0-aec6-10a25a7ec9c3
15
15
caps.latest.revision: 55
16
16
ms.author: "matp"
17
-
manager: "brycho"
17
+
manager: "kvivek"
18
18
search.audienceType:
19
19
- maker
20
20
search.app:
@@ -43,18 +43,27 @@ There are two designers you can use to create or edit fields:
43
43
44
44
Information in this topic will help you choose which designer you can use.
45
45
46
-
You should use the PowerApps portal to Create and edit fields for Common Data Service for Appsunless you need to address any of the following requirements:
46
+
You should use the PowerApps portal to Create and edit fields for Common Data Service for Apps unless you need to address any of the following requirements:
47
47
48
-
- Create a Customer Lookup field
49
-
- Create a field in a solution other than the CDS Default solution
50
-
- Define status reason transitions
51
-
- Edit multiple fields at once
52
-
- Enable Auditing
53
-
- Enable Field Level Security
54
-
- Select whether the field appears in global filter in interactive experience
55
-
- Select whether the field is sortable in interactive experience dashboards
56
-
- Set a field Requirement Level as Business Recommended
57
-
- Set managed properties for a field
48
+
- Create a Customer Lookup field.
49
+
- More information: [Different types of lookups](types-of-fields.md#different-types-of-lookups)
50
+
- Create a field in a solution other than the CDS Default solution.
51
+
- More information: [Solutions overview](solutions-overview.md)
52
+
- Define status reason transitions.
53
+
- More information: [Define status reason transitions for the Case or custom entities](define-status-reason-transitions.md)
54
+
- Edit multiple fields at once.
55
+
- Enable Auditing.
56
+
- More information: [Auditing overview](../../developer/common-data-service/auditing-overview.md)
57
+
- Enable Field Level Security.
58
+
- More information: [Field security entities](../../developer/common-data-service/field-security-entities.md)
59
+
- Select whether the field appears in global filter in interactive experience.
60
+
- More information: [Configure model-driven app interactive experience dashboards](../model-driven-apps/configure-interactive-experience-dashboards.md)
61
+
- Select whether the field is sortable in interactive experience dashboards.
62
+
- More information: [Configure model-driven app interactive experience dashboards](../model-driven-apps/configure-interactive-experience-dashboards.md)
63
+
- Set a field Requirement Level as Business Recommended.
64
+
- More information: [Create business rules and recommendations to apply logic in a model-driven app form](../model-driven-apps/create-business-rules-recommendations-apply-logic-form.md)
65
+
- Set managed properties for a field.
66
+
- More information: [Set managed properties for fields](set-managed-properties-for-field.md)
58
67
59
68
> [!NOTE]
60
69
> You can create a Lookup field in the PowerApps portal or in solution explorer by creating a One-to-many relationship on the entity. But only solution explorer offers the option to create this relationship while creating a field.
0 commit comments