Skip to content

Commit 3892036

Browse files
authored
Merge branch 'live' into patch-6
2 parents 7872ce2 + bd18292 commit 3892036

File tree

280 files changed

+2530
-1222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+2530
-1222
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"redirections": [
3+
{
4+
"source_path": "powerapps-docs/maker/canvas-apps/monitor.md",
5+
"redirect_url": "../monitor-canvasapps",
6+
"redirect_document_id": "false"
7+
},
38
{
49
"source_path": "powerapps-docs/user/use-custom-model-driven-app-on-mobile.md",
510
"redirect_url": "../mobile/use-custom-model-driven-app-on-mobile",

powerapps-docs/developer/common-data-service/create-custom-api-maker-portal.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Create a Custom API in the maker portal (Microsoft Dataverse) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
33
description: "Create a Custom API definition with the maker portal" # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.custom: ""
5-
ms.date: 10/26/2020
5+
ms.date: 11/26/2020
66
ms.reviewer: "pehecke"
77
ms.service: powerapps
88
ms.topic: "article"
@@ -102,7 +102,10 @@ If the Custom API is bound to an **Entity** or **EntityCollection**, that parame
102102
103103
## Create any Response Properties
104104

105-
A Custom API doesn't require response properties. If the operation succeeds, it will return a success response. If it fails, it will return an error. You should define response properties for any data that your API will return.
105+
A Custom API that represents an action doesn't require response properties. If the operation succeeds, it will return a success response. If it fails, it will return an error. You should define response properties for any data that your API will return.
106+
107+
> [!IMPORTANT]
108+
> A Custom API that represents a function requires at least one response property to be valid.
106109
107110
If there is only a single **Entity** or **EntityCollection** response property defined, the response will be of that type. If there are multiple parameters, or one or more parameter of a simple type, the API will return a complex type where each response property will be a property of that complex type. For example, if your Custom API Unique name is `sample_CustomAPIExample`, it will return a complex type named `sample_CustomAPIExampleResponse` with properties for each response property you define.
108111

powerapps-docs/developer/common-data-service/custom-api.md

Lines changed: 85 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Create and use Custom APIs (Microsoft Dataverse) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
33
description: "Custom API is a new code-first way to define custom messages for the Microsoft Dataverse" # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.custom: ""
5-
ms.date: 10/27/2020
5+
ms.date: 11/26/2020
66
ms.reviewer: "pehecke"
77
ms.service: powerapps
88
ms.topic: "article"
@@ -57,7 +57,7 @@ This table includes attributes of the Custom API entity that you can set.
5757
|**Description**<br />`Description`|String|Localized description for this Custom API. For use when the message is exposed to be called in an app. For example, as a [ToolTip](https://wikipedia.org/wiki/Tooltip).|
5858
|**Display Name**<br />`DisplayName`|String|Localized display name for this Custom API. For use when the message is exposed to be called in an app.|
5959
|**Execute Privilege Name**<br />`ExecutePrivilegeName`|String|(Optional) Name of the privilege that allows execution of the custom API|
60-
|**Is Function**<br />`IsFunction`|Boolean|Indicates if the custom API is a function. A function requires the HTTP GET method. Otherwise the Http POST method is required.<ul> <li>**Value**: 0 **Label**: No</li> <li>**Value**: 1 **Label**: Yes</li> </ul>More information: [Use Web API functions](webapi/use-web-api-functions.md)<br />**Cannot be changed after it is saved.**|
60+
|**Is Function**<br />`IsFunction`|Boolean|Indicates if the custom API is a function. A function requires the HTTP GET method. Otherwise the Http POST method is required.<ul> <li>**Value**: 0 **Label**: No</li> <li>**Value**: 1 **Label**: Yes</li> </ul>**Important**: A function MUST include at least one Response Property to be valid.<br/>More information: [Use Web API functions](webapi/use-web-api-functions.md)<br />**Cannot be changed after it is saved.**|
6161
|**Is Private**<br />`IsPrivate`|Boolean|Indicates if the custom API is private (hidden from metadata and documentation) More information: [Private Messages](org-service/use-messages.md#private-messages)<ul> <li>**Value**: 0 **Label**: No </li> <li>**Value**: 1 **Label**: Yes</li> </ul>|
6262
|**Name**<br />`Name`|String|The primary name of the custom API. This will display in the list of custom apis when viewed in the solution.|
6363
|**Owner**<br />`OwnerId`|Owner|A reference to the user or team that owns the API. |
@@ -97,15 +97,22 @@ This table includes attributes of the Custom API Request Parameter entity that y
9797
|**Logical Entity Name**<br />`LogicalEntityName`|String|The logical name of the entity bound to the custom API request parameter.<br/>**Cannot be changed after it is saved.**|
9898
|**Name**<br />`Name`|String|The primary name of the custom API request parameter. This will display in the list of custom api request parameters when viewed in the solution. Use this to differentiate this parameter from others that share a common Unique Name. <br />This naming convention is recommended: `{Custom API Unique Name}.{Parameter UniqueName}`|
9999
|**Owner** <br />`OwnerId`|Owner|A reference to the user or team that owns the API.|
100-
|**Type**<br />`Type`|Picklist|The data type of the custom API request parameter.<ul> <li>**Value**: 0 **Label**: Boolean </li> <li>**Value**: 1 **Label**: DateTime</li> <li>**Value**: 2 **Label**: Decimal </li> <li>**Value**: 3 **Label**: Entity</li> <li>**Value**: 4 **Label**: EntityCollection </li> <li>**Value**: 5 **Label**: EntityReference</li> <li>**Value**: 6 **Label**: Float </li> <li>**Value**: 7 **Label**: Integer</li> <li>**Value**: 8 **Label**: Money </li> <li>**Value**: 9 **Label**: Picklist</li> <li>**Value**: 10 **Label**: String </li> </ul>**Cannot be changed after it is saved.**|
100+
|**Type**<br />`Type`|Picklist|The data type of the custom API request parameter.<ul> <li>**Value**: 0 **Label**: Boolean </li> <li>**Value**: 1 **Label**: DateTime</li> <li>**Value**: 2 **Label**: Decimal </li> <li>**Value**: 3 **Label**: Entity</li> <li>**Value**: 4 **Label**: EntityCollection </li> <li>**Value**: 5 **Label**: EntityReference</li> <li>**Value**: 6 **Label**: Float </li> <li>**Value**: 7 **Label**: Integer</li> <li>**Value**: 8 **Label**: Money </li> <li>**Value**: 9 **Label**: Picklist</li> <li>**Value**: 10 **Label**: String </li> <li>**Value**: 11 **Label**: StringArray </li> <li>**Value**: 12 **Label**: Guid </li> </ul>**Cannot be changed after it is saved.**|
101101
|**Unique Name** <br />`UniqueName`|String|Unique name for the custom API request parameter. This will be the name of the parameter when you call the Custom API.<br/>**Cannot be changed after it is saved.**|
102102

103103
> [!NOTE]
104104
> Some values are not valid for update. They cannot be changed after the Custom API Request Parameter is saved. If you need to change one of these values, you must delete the Custom API Request Parameter and re-create it with the changes you want to make.
105105
106106
### CustomAPIResponseProperty entity attributes
107107

108-
The object returned for your Custom API message will include any response properties you define. It is not required for a Custom API to return any value, but if the custom API is defined as a function it is expected.
108+
The object returned for your Custom API message will include any response properties you define. It is not required for a Custom API to return any value, but if the custom API is defined as a function it is required.
109+
110+
> [!IMPORTANT]
111+
> A Custom API that represents a function with no response properties is not valid and will not appear in the Web API $metadata service document. If you try to use it, you will get a `404 Not Found` error similar to this:
112+
>
113+
> `{"error":{"code":"0x8006088a","message":"Resource not found for the segment 'your_function_name'."}}`.
114+
>
115+
> You must also set the data to be returned in the plug-in for the function. If no data is set to be returned by the plug-in, the operation will return `204 No Content`.
109116
110117
If there is only a single **Entity** or **EntityCollection** response property defined, the response will be of that type. If there are multiple parameters, or one or more parameter of a simple type, the API will return a complex type where each response property will be a property of that complex type. For example, if your Custom API Unique name is `sample_CustomAPIExample`, it will return a complex type named `sample_CustomAPIExampleResponse` with properties for each response property you define.
111118

@@ -120,7 +127,7 @@ This table includes attributes of the Custom API Response Property entity that y
120127
|**Logical Entity Name**<br />`LogicalEntityName`|String|The logical name of the entity bound to the custom API response property .<br/>**Cannot be changed after it is saved.**|
121128
|**Name**<br />`Name`|String|The primary name of the custom API response property . This will display in the list of custom api request parameters when viewed in the solution. Use this to differentiate this parameter from others that share a common Unique Name. <br />This naming convention is recommended: `{Custom API Unique Name}.{Property UniqueName}`|
122129
|**Owner** <br />`OwnerId`|Owner|A reference to the user or team that owns the API.|
123-
|**Type**<br />`Type`|Picklist|The data type of the custom API response property <ul> <li>**Value**: 0 **Label**: Boolean </li> <li>**Value**: 1 **Label**: DateTime</li> <li>**Value**: 2 **Label**: Decimal </li> <li>**Value**: 3 **Label**: Entity</li> <li>**Value**: 4 **Label**: EntityCollection </li> <li>**Value**: 5 **Label**: EntityReference</li> <li>**Value**: 6 **Label**: Float </li> <li>**Value**: 7 **Label**: Integer</li> <li>**Value**: 8 **Label**: Money </li> <li>**Value**: 9 **Label**: Picklist</li> <li>**Value**: 10 **Label**: String </li> </ul>**Cannot be changed after it is saved.**|
130+
|**Type**<br />`Type`|Picklist|The data type of the custom API response property <ul> <li>**Value**: 0 **Label**: Boolean </li> <li>**Value**: 1 **Label**: DateTime</li> <li>**Value**: 2 **Label**: Decimal </li> <li>**Value**: 3 **Label**: Entity</li> <li>**Value**: 4 **Label**: EntityCollection </li> <li>**Value**: 5 **Label**: EntityReference</li> <li>**Value**: 6 **Label**: Float </li> <li>**Value**: 7 **Label**: Integer</li> <li>**Value**: 8 **Label**: Money </li> <li>**Value**: 9 **Label**: Picklist</li> <li>**Value**: 10 **Label**: String </li> <li>**Value**: 11 **Label**: StringArray </li> <li>**Value**: 12 **Label**: Guid </li> </ul>**Cannot be changed after it is saved.**|
124131
|**Unique Name** <br />`UniqueName`|String|Unique name for the custom API response property . This will be the name of the parameter when you call the Custom API.<br/>**Cannot be changed after it is saved.**|
125132

126133
> [!NOTE]
@@ -185,7 +192,7 @@ More information: [Use FetchXML to construct a query](use-fetchxml-construct-que
185192
<attribute name='boundentitylogicalname' />
186193
<attribute name='bindingtype' />
187194
<attribute name='uniquename' />
188-
<link-entity name='customapirequestparameter' from='customapiid' to='customapiid' alias='req' >
195+
<link-entity name='customapirequestparameter' from='customapiid' to='customapiid' link-type='outer' alias='req' >
189196
<attribute name='description' />
190197
<attribute name='displayname' />
191198
<attribute name='logicalentityname' />
@@ -194,15 +201,15 @@ More information: [Use FetchXML to construct a query](use-fetchxml-construct-que
194201
<attribute name='type' />
195202
<attribute name='isoptional' />
196203
</link-entity>
197-
<link-entity name='customapiresponseproperty' from='customapiid' to='customapiid' >
204+
<link-entity name='customapiresponseproperty' from='customapiid' to='customapiid' link-type='outer' >
198205
<attribute name='description' />
199206
<attribute name='displayname' />
200207
<attribute name='logicalentityname' />
201208
<attribute name='name' />
202209
<attribute name='uniquename' />
203210
<attribute name='type' />
204211
</link-entity>
205-
<link-entity name='plugintype' from='plugintypeid' to='plugintypeid' alias='plugintype' >
212+
<link-entity name='plugintype' from='plugintypeid' to='plugintypeid' link-type='outer' alias='plugintype' >
206213
<attribute name='name' />
207214
<attribute name='assemblyname' />
208215
<attribute name='version' />
@@ -248,13 +255,13 @@ SELECT api.customapiid,
248255
type.name,
249256
type.assemblyname
250257
FROM customapi AS api
251-
INNER JOIN
258+
LEFT JOIN
252259
customapirequestparameter AS req
253260
ON api.customapiid = req.customapiid
254-
INNER JOIN
261+
LEFT JOIN
255262
customapiresponseproperty AS resp
256263
ON api.customapiid = resp.customapiid
257-
INNER JOIN
264+
LEFT JOIN
258265
plugintype AS type
259266
ON api.plugintypeid = type.plugintypeid
260267
```
@@ -272,6 +279,53 @@ The following example shows editing the Excel worksheet to add Japanese translat
272279
> [!TIP]
273280
> If you are editing the solution files to create your Custom APIs, you can provide the localized labels directly. More information: [Providing Localized Labels with the solution](create-custom-api-solution.md#providing-localized-labels-with-the-solution)
274281
282+
### Setting localized values
283+
284+
If you prefer to set localized labels in code rather than using the manual process described above, you can use the `SetLocLabels` message using either the Web API [SetLocLabels Action](/dynamics365/customer-engagement/web-api/setloclabels) or the Organization Service <xref:Microsoft.Crm.Sdk.Messages.SetLocLabelsRequest>.
285+
286+
The following example shows how to use the Web API to set the localized labels for the `displayname` property of a custom API.
287+
288+
289+
**Request**
290+
291+
```http
292+
POST [Organization URI]/api/data/v9.1/SetLocLabels HTTP/1.1
293+
Accept: application/json
294+
OData-MaxVersion: 4.0
295+
OData-Version: 4.0
296+
Content-Type: application/json
297+
298+
{
299+
"EntityMoniker": {
300+
"@odata.type": "Microsoft.Dynamics.CRM.customapi",
301+
"customapiid": "86bcd12e-2f30-eb11-a813-000d3a122b89"
302+
},
303+
"AttributeName": "displayname",
304+
"Labels": [
305+
{
306+
"Label": "例え",
307+
"LanguageCode": 1041
308+
},
309+
{
310+
"Label": "Beispiel",
311+
"LanguageCode": 1031
312+
},
313+
{
314+
"Label": "ejemplo",
315+
"LanguageCode": 1034
316+
}
317+
]
318+
}
319+
320+
```
321+
322+
**Response**
323+
324+
```http
325+
HTTP/1.1 204 No Content
326+
```
327+
328+
275329
### Retrieving localized values
276330

277331
To retrieve the localized labels use the `RetrieveLocLabels` message using either the Web API [RetrieveLocLabels Function](/dynamics365/customer-engagement/web-api/retrieveloclabels) or the Organization Service <xref:Microsoft.Crm.Sdk.Messages.RetrieveLocLabelsRequest>.
@@ -341,7 +395,9 @@ A: You cannot. Although these records have the common **Status** and **Status Re
341395

342396
### Q: How can I use my private messages if they are not included in the Web API $metadata service document?
343397

344-
A: Your private messages will work regardless of whether they are advertised in the Web API [CSDL $metadata document](webapi/web-api-types-operations.md#csdl-metadata-document) or not. While you develop your solution, you can leave the `IsPrivate` value set to `false`. This way you can refer to the `$metadata` listing and use code generation tools that depend on this data. However, you should set the `CustomAPI.IsPrivate` value to `false` before you ship your solution for others to use. If you later decide that you wish to support other applications to use the message, you can change the `CustomAPI.IsPrivate` value to `true`. More information: [Private Messages](org-service/use-messages.md#private-messages)
398+
A: Your private messages will work regardless of whether they are advertised in the Web API [CSDL $metadata document](webapi/web-api-types-operations.md#csdl-metadata-document) or not. While you develop your solution, you can leave the `IsPrivate` value set to `false`. This way you can refer to the `$metadata` listing and use code generation tools that depend on this data. However, you should set the `CustomAPI.IsPrivate` value to `false` before you ship your solution for others to use. If you later decide that you wish to support other applications to use the message, you can change the `CustomAPI.IsPrivate` value to `true`.
399+
400+
More information: [Private Messages](org-service/use-messages.md#private-messages) and [Private messages cannot be used in plug-ins](#private-messages-cannot-be-used-in-plug-ins)
345401

346402
## Known issues with Custom APIs
347403

@@ -381,6 +437,23 @@ It is not possible to create the Custom API, Custom API Request Parameter, and C
381437

382438
If you define your Custom API as a function by setting the **Is Function** property to true, you cannot bind the function to an entity or entity collection. You also cannot use any **Entity** or **EntityCollection** request parameters.
383439

440+
If you attempt this with a function bound to the account entity, you can expect a `400 Bad Request` error like this:
441+
442+
`GET [Organization URL]/api/data/v9.1/accounts/Microsoft.Dynamics.CRM.new_CollectionBoundFunction()`
443+
444+
```json
445+
{
446+
"error": {
447+
"code": "0x8006088a",
448+
"message": "The request URI is not valid. Since the segment 'accounts' refers to a collection, this must be the last segment in the request URI or it must be followed by an function or action that can be bound to it otherwise all intermediate segments must refer to a single resource."
449+
}
450+
}
451+
```
452+
453+
### Private messages cannot be used in plug-ins
454+
455+
If you define your custom API to be private, you cannot use that message in a plug-in. More information: [Private Messages](org-service/use-messages.md#private-messages)
456+
384457
### Next Steps
385458

386459
[Create a Custom API in the maker portal](create-custom-api-maker-portal.md)<br />

powerapps-docs/developer/common-data-service/org-service/samples/validate-record-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ search.app:
2020

2121
[!INCLUDE[cc-data-platform-banner](../../../../includes/cc-data-platform-banner.md)]
2222

23-
This sample shows how to validate a change of state of an entity and set a state of an entity. You can download the sample from [here](https://github.com/microsoft/PowerApps-Samples/tree/master/cds/orgsvc/C%23/ValidateandExecuteSavedQuery).
23+
This sample shows how to validate a change of state of an entity and set a state of an entity. You can download the sample from [here](https://github.com/microsoft/PowerApps-Samples/tree/master/cds/orgsvc/C%23/ValidateAndSetRecordState).
2424

2525
## How to run this sample
2626

powerapps-docs/developer/common-data-service/org-service/use-messages.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Use messages with the Organization service (Microsoft Dataverse) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
33
description: "Understand how messages are used to invoke operations using the organization service." # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.custom: ""
5-
ms.date: 10/26/2020
5+
ms.date: 11/26/2020
66
ms.reviewer: "pehecke"
77
ms.service: powerapps
88
ms.topic: "article"
@@ -135,6 +135,7 @@ Microsoft Dataverse contains some messages which are not intended for 3rd party
135135

136136
> [!CAUTION]
137137
> You should not use private messages unless you created them as a Custom API. By marking a message as private, the solution publisher is explicitly calling out that they do not support other apps to use the message. They may remove the message or introduce breaking changes at any time. Use of these messages by anyone other than the solution publisher are not supported.
138+
> Calling private messages from plug-ins is not supported.
138139
139140
More information: [Create and use Custom APIs](../custom-api.md)
140141

0 commit comments

Comments
 (0)