Skip to content

Commit 0ad43f0

Browse files
committed
Merge branch 'master' into michu-pachecker-4599547-api-docs
2 parents b6bec00 + d927a93 commit 0ad43f0

Some content is hidden

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

41 files changed

+712
-85
lines changed

powerapps-docs/developer/common-data-service/developer-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The following tools are distributed in NuGet packages. The [Developer Guide: Dow
2626

2727
|Tool |Description |
2828
|---------|---------|
29-
|Code generation tool `CrmSvcUtil.exe`|A command-line code generation tool that generates early-bound .NET Framework classes that represent the entity data model used by the organization service. <br />More information: <br />[Organization Service](work-with-data-cds.md#organization-service)<br />[Create early bound entity classes with the code generation tool ](/dynamics365/customer-engagement/developer/org-service/create-early-bound-entity-classes-code-generation-tool)|
29+
|Code generation tool `CrmSvcUtil.exe`|A command-line code generation tool that generates early-bound .NET Framework classes that represent the entity data model used by the organization service. <br />More information: <br />[Organization Service](work-with-data-cds.md#organization-service)<br />[Create early bound entity classes with the code generation tool](/dynamics365/customer-engagement/developer/org-service/create-early-bound-entity-classes-code-generation-tool)|
3030
|Configuration Migration tool `DataMigrationUtility.exe`|Used to move configuration data across environments. Configuration data is used to define custom functionality and is typically stored in custom entities. This tool is not designed to move business data. <br /> More information: [Common Data Service Administrator Guide: Move configuration data across instances and organizations with the Configuration Migration tool](/dynamics365/customer-engagement/admin/manage-configuration-data)|
3131
|Package Deployer `PackageDeployer.exe`|Used to deploy packages on Common Data Service instances. A package is an installable unit that includes solutions. <br /> More information: <br />[Deploy Solution Packages](introduction-solutions.md#deploy-solution-packages)<br />[Create packages for the Common Data Service Package Deployer](/dynamics365/customer-engagement/developer/create-packages-package-deployer)|
3232
|Plug-in Registration Tool `PluginRegistration.exe`|A tool used to subscribe .NET assembly plug-in classes to server events. <br />More information: <br />[Create a plug-in](apply-business-logic-with-code.md#create-a-plug-in)<br />[Register a plug-in](register-plug-in.md)|

powerapps-docs/developer/common-data-service/entity-attribute-metadata.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ In the following table:
8282
|Collection|`CalendarRulesType`|No|Contains a collection of `CalendarRules` entity records.<br />There are no attributes that use this type. When generating a proxy, the code generation tool will create two simulated attributes that are not present in the metadata. These attributes represent a view of the calendar rules records associated in a one-to-many relationship to the entity record.|
8383
|Collection|`PartyListType`|No|Contains a collection of `ActivityParty` entity records.<br />More information: [ActivityParty entity](reference/entities/activityparty.md)|
8484
|Date and Time|`DateTimeType`<br />[DateTimeAttributeMetadata](/dotnet/api/microsoft.xrm.sdk.metadata.datetimeattributemetadata)|Yes<br />**Date and Time**|Contains a date and time value.<br />All date and time attributes support values as early as 1/1/1753 12:00 AM.|
85-
|Image|`ImageType`<br />[ImageAttributeMetadata]()|Yes<br />**Image**|Contains data to support retrieving image data for an entity record.<br />More information: [Entity Images](entity-metadata.md#entity-images)|
86-
|Managed Property|`ManagedPropertyType`<br />[ManagedPropertyAttributeMetadata](/dotnet/api/microsoft.xrm.sdk.metadata.imageattributemetadata)|No|Contains data that describe whether the solution component stored in the entity record can be customized when included in a managed solution.<br />More information: [Managed Properties](introduction-solutions.md#managed-properties)|
85+
|Image|`ImageType`<br />[ImageAttributeMetadata](/dotnet/api/microsoft.xrm.sdk.metadata.imageattributemetadata)|Yes<br />**Image**|Contains data to support retrieving image data for an entity record.<br />More information: [Entity Images](entity-metadata.md#entity-images)|
86+
|Managed Property|`ManagedPropertyType`<br />[ManagedPropertyAttributeMetadata](/dotnet/api/microsoft.xrm.sdk.metadata.managedpropertyattributemetadata)|No|Contains data that describe whether the solution component stored in the entity record can be customized when included in a managed solution.<br />More information: [Managed Properties](introduction-solutions.md#managed-properties)|
8787
|Quantity|`BigIntType`<br />[BigIntAttributeMetadata](/dotnet/api/microsoft.xrm.sdk.metadata.bigintattributemetadata)|No|Contains a `BigInt` value. For internal use only.|
8888
|Quantity|`DecimalType`<br />[DecimalAttributeMetadata](/dotnet/api/microsoft.xrm.sdk.metadata.decimalattributemetadata)|Yes<br />**Decimal Number**|Contains a `Decimal` value. The `Precision` property sets the level of precision.|
8989
|Quantity|`DoubleType`<br />[DoubleAttributeMetadata](/dotnet/api/microsoft.xrm.sdk.metadata.doubleattributemetadata)|Yes<br />**Floating Point Number**|Contains a `Double` value. The `Precision` property sets the level of precision.|

powerapps-docs/developer/common-data-service/event-framework.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: " Event Framework (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
33
description: "Describes the event framework and information developers should know when working with it." # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.custom: ""
5-
ms.date: 05/25/2019
5+
ms.date: 06/18/2019
66
ms.reviewer: ""
77
ms.service: powerapps
88
ms.topic: "article"
@@ -45,7 +45,27 @@ Generally, you can expect to find a message for most of the **Request* classes i
4545

4646
Data about messages is stored in the [SdkMessage](reference/entities/sdkmessage.md) and [SdkMessageFilter](reference/entities/sdkmessagefilter.md) entities. The Plug-in registration tool will filter this information to only show valid messages.
4747

48-
To verify if a message and entity combination supports execution of plug-ins using a database query, use Advanced Find or a community tool (e.g., [FetchXML Builder](http://fxb.xrmtoolbox.com)) to execute the following fetchXML query. When using Advanced Find, you must create the query interactively.
48+
To verify if a message and entity combination supports execution of plug-ins using a database query, you can use the following Web API query:
49+
50+
```
51+
{{webapiurl}}sdkmessages?$select=name
52+
&$filter=isprivate eq false
53+
and (name ne 'SetStateDynamicEntity'
54+
and name ne 'RemoveRelated'
55+
and name ne 'SetRelated' and
56+
name ne 'Execute')
57+
and sdkmessageid_sdkmessagefilter/any(s:s/iscustomprocessingstepallowed eq true
58+
and s/isvisible eq true)
59+
&$expand=sdkmessageid_sdkmessagefilter($select=primaryobjecttypecode;
60+
$filter=iscustomprocessingstepallowed eq true and isvisible eq true)
61+
&$orderby=name
62+
```
63+
64+
> [!TIP]
65+
> You can export this data to an Excel worksheet using this query and the instructions provided in this blog post: [Find Messages and entities eligible for plug-ins using the Common Data Service](https://powerapps.microsoft.com/en-us/blog/find-messages-and-entities-eligible-for-plug-ins-using-the-common-data-service/)
66+
67+
68+
You can also use the following FetchXML to retrieve this information. The [FetchXML Builder](http://fxb.xrmtoolbox.com) is a useful tool to execute this kind of query.
4969

5070
```xml
5171
<fetch>

powerapps-docs/developer/common-data-service/org-service/generate-early-bound-classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The classes created by the code generation tool are designed to be built into a
3737
The following lists assemblies that must be referenced in your project when you use the generated code file.
3838

3939
- `Microsoft.Crm.Sdk.Proxy.dll`
40-
- `Microsoft.Xrm.Sdk.dll `
40+
- `Microsoft.Xrm.Sdk.dll`
4141

4242
These assemblies are part of the [Microsoft.CrmSdk.CoreAssemblies](https://www.nuget.org/packages/Microsoft.CrmSdk.CoreAssemblies/) NuGet package. Use this Nuget packages to add these assemblies to your Visual Studio project.
4343

powerapps-docs/developer/common-data-service/org-service/handle-exceptions-code.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ catch (System.Exception ex)
7373
7474
In addition to these exceptions and faults, your code must handle the following exceptions:
7575

76-
- [SecurityTokenValidationException](https://msdn.microsoft.com/library/system.identitymodel.tokens.securitytokenvalidationexception.aspx)
77-
- [ExpiredSecurityTokenException](https://msdn.microsoft.com/library/system.servicemodel.security.expiredsecuritytokenexception.aspx)
78-
- [SecurityAccessDeniedException](https://msdn.microsoft.com/library/system.servicemodel.security.securityaccessdeniedexception.aspx)
79-
- [MessageSecurityException](https://msdn.microsoft.com/library/system.servicemodel.security.messagesecurityexception.aspx)
80-
- [SecurityNegotiationException](https://msdn.microsoft.com/library/system.servicemodel.security.securitynegotiationexception.aspx)
76+
- [SecurityTokenValidationException](/dotnet/api/system.identitymodel.tokens.securitytokenvalidationexception)
77+
- [ExpiredSecurityTokenException](/dotnet/api/system.servicemodel.security.expiredsecuritytokenexception)
78+
- [SecurityAccessDeniedException](/dotnet/api/system.servicemodel.security.securityaccessdeniedexception)
79+
- [MessageSecurityException](/dotnet/api/system.servicemodel.security.messagesecurityexception)
80+
- [SecurityNegotiationException](/dotnet/api/system.servicemodel.security.securitynegotiationexception)
8181

8282
When connecting to Common Data Service, a `SecurityAccessDeniedException` exception can be thrown if you use a valid Microsoft account and your account is not associated with any Common Data Service organization. A `MessageSecurityException` can be thrown if your Microsoft account isn’t valid or there was an authentication failure.
8383

@@ -119,7 +119,7 @@ Sync workflow 'Name of Entity Scope Business Rule returning Error' terminated wi
119119
</OrganizationServiceFault>
120120
```
121121

122-
More information: [Create and edit Business Rules](https://technet.microsoft.com/library/dn531086.aspx).
122+
More information: [Create a business rule for an entity](../../../maker/common-data-service/data-platform-create-business-rule.md)
123123

124124
<a name="BKMK_AdditionalInfo"></a>
125125

powerapps-docs/developer/common-data-service/security-model.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Security Model (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
33
description: "PowerApps provides a security model that protects data integrity and privacy, and supports efficient data access and collaboration" # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.custom: ""
5-
ms.date: 10/31/2018
5+
ms.date: 06/18/2019
66
ms.reviewer: ""
77
ms.service: powerapps
88
ms.topic: "article"
@@ -33,8 +33,5 @@ Combine role-based security, record-level security, and field-level security to
3333
As a developer, you should know that your queries run in the context of a user, and will only return records that the user is entitled to read.
3434
Further, you will only be able to perform operations based on the privileges assigned to your user account through the security roles.
3535

36-
For detailed information about the security concepts, see [Security concepts](/dynamics365/customer-engagement/admin/security-concepts)
36+
For detailed information, see [Security in Common Data Service](/power-platform/admin/wp-security)
3737

38-
### See also
39-
40-
[BusinessUnit entity](businessunit-entity.md)

powerapps-docs/developer/common-data-service/troubleshoot-plug-in.md

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ TODO: Add content that shows how to do this -->
7373

7474
## Error: Message size exceeded when sending context to Sandbox
7575

76-
<!-- This is the error code for an unexpected error we should be providing a specific error code -->
76+
<!-- This is the error code for an unexpected error we should be providing a specific error code. Bug 1470173 is tracking this. -->
7777
Error Code: `-2147220970`<br />
7878
Error Message: `Message size exceeded when sending context to Sandbox. Message size: ### Mb`
7979

@@ -87,3 +87,57 @@ If you encounter this error you can:
8787

8888
1. Remove the plug-in for the message. If there are no plug-ins registered for the message, the operation will complete without an error.
8989
2. If the error is occurring in a custom client, you can modify your code so that it doesn't attempt to perform the work in a single operation. Instead, write code to retrieve the data in smaller parts.
90+
91+
## Error: The given key was not present in the dictionary
92+
93+
Common Data Service frequently uses classes derived from the abstract <xref:Microsoft.Xrm.Sdk.DataCollection`2> class that represents a collection of keys and values. For example, with plug-ins the <xref:Microsoft.Xrm.Sdk.IExecutionContext>.<xref:Microsoft.Xrm.Sdk.IExecutionContext.InputParameters> property is a <xref:Microsoft.Xrm.Sdk.ParameterCollection> derived from the <xref:Microsoft.Xrm.Sdk.DataCollection`2> class. These classes are essentially dictionary objects where you access a specific value using the key name.
94+
95+
### Error codes
96+
97+
This error occurs when the key value in code doesn't exist in the collection. This is a run-time error rather a platform error. When this error occurs within a plug-in, the error code will depend on whether the error was caught.
98+
99+
If the developer caught the exception and returned an <xref:Microsoft.Xrm.Sdk.InvalidPluginExecutionException> as described in [Handle exceptions in plug-ins](handle-exceptions.md), the following error will be returned:
100+
101+
Error Code: `-2147220891`<br />
102+
Error Message: `ISV code aborted the operation.`
103+
104+
However, with this error it is common that the developer doesn't catch it properly and the following error will be returned:
105+
106+
Error Code: `-2147220956`<br />
107+
Error Message: `An unexpected error occurred from ISV code.`
108+
109+
> [!NOTE]
110+
> "ISV" stands for *Independent Software Vendor*.
111+
112+
### Causes
113+
114+
This error frequently occurs at design time and can be due to a misspelling or using the incorrect casing. The key values are case sensitive.
115+
116+
At run-time the error is frequently due to the developer assuming that the value will be present when it isn't. For example, in a plug-in that is registered for the update of an entity, only those values which are changed will be included in the <xref:Microsoft.Xrm.Sdk.Entity>.<xref:Microsoft.Xrm.Sdk.Entity.Attributes> collection.
117+
118+
### Prevention
119+
120+
To prevent this error you must check that the key exists before attempting to use it to access a value.
121+
122+
For example, when accessing an entity attribute, you can use the <xref:Microsoft.Xrm.Sdk.Entity>.<xref:Microsoft.Xrm.Sdk.Entity.Contains(System.String)> method to check whether an attribute exists in an entity as shown in the following code.
123+
124+
```csharp
125+
// Obtain the execution context from the service provider.
126+
IPluginExecutionContext context = (IPluginExecutionContext)
127+
serviceProvider.GetService(typeof(IPluginExecutionContext));
128+
129+
// The InputParameters collection contains all the data passed in the message request.
130+
if (context.InputParameters.Contains("Target") &&
131+
context.InputParameters["Target"] is Entity)
132+
{
133+
// Obtain the target entity from the input parameters.
134+
Entity entity = (Entity)context.InputParameters["Target"];
135+
136+
//Check whether the name attribute exists.
137+
if(entity.Contains("name"))
138+
{
139+
string name = entity["name"];
140+
}
141+
```
142+
143+
Some developers use the <xref:Microsoft.Xrm.Sdk.Entity>.<xref:Microsoft.Xrm.Sdk.Entity.GetAttributeValue``1(System.String)> method to avoid this error when accessing entity attributes, but be aware that this method will return the default value of the type if the attribute doesn't exist. If the default value is null, this works as expected. But if the default value doesn't return null, such as with a `DateTime`, the value returned will be `1/1/0001 00:00` rather than null.

powerapps-docs/developer/common-data-service/tutorial-write-plug-in.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ In Visual Studio, press **F6** to build the assembly. Verify that it compiles wi
209209
1. Click **OK** to close the **Create Strong Name Key** dialog.
210210
1. In the project properties **Build** tab, verify that the **Configuration** is set to **Debug**.
211211
1. Press **F6** to build the plug-in again.
212-
1. Using windows explorer, find the built plug-in at:` \bin\Debug\BasicPlugin.dll`.
212+
1. Using windows explorer, find the built plug-in at: `\bin\Debug\BasicPlugin.dll`.
213213

214214
> [!NOTE]
215215
> Build the assembly using **Debug** configuration because you will use the Plug-in profiler to debug it in a later tutorial. Before you include a plug-in with your solution, you should build it using the release configuration.

powerapps-docs/developer/common-data-service/understand-the-data-context.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Understand the execution context (Common Data Service) | Microsoft Docs"
33
description: "Learn about the data that is passed to your plug-ins when it is executed."
44
ms.custom: ""
5-
ms.date: 05/25/2019
5+
ms.date: 06/20/2019
66
ms.reviewer: pehecke
77
ms.service: powerapps
88
ms.topic: "article"
@@ -168,11 +168,12 @@ When you define an entity image, you specify an entity alias value you can use t
168168
var oldAccountName = (string)context.PreEntityImages["a"]["name"];
169169
```
170170

171-
More information: [Define entity images](register-plug-in.md#define-entity-images)
171+
More information:
172+
173+
- [Define entity images](register-plug-in.md#define-entity-images)
174+
- [Entity Images for workflow extensions](workflow/workflow-extensions.md#entity-images-for-workflow-extensions)
172175

173-
### Entity Images for custom workflow activites
174176

175-
There is no way to configure entity images for custom workflow activities since you only register the assembly and the workflow activity runs in the context of the workflow. For custom workflow activities entity images are available using the key values `PreBusinessEntity` and `PostBusinessEntity` respectively for the pre and post entity images.
176177

177178
### See also
178179

powerapps-docs/developer/common-data-service/use-change-tracking-synchronize-data-external-systems.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The change tracking feature in Common Data Service provides a way to keep the da
2222
<a name="BKMK_enable"></a>
2323
## Enable change tracking for an entity
2424

25-
Before retrieving the changes for an entity, make sure that the change tracking feature is enabled for that entity. This feature can be enabled by using the customization user interface (UI) or programmatically by setting the <xref:Microsoft.Xrm.Sdk.Metadata.EntityMetadata.ChangeTrackingEnabled> property to `True`. Annotation `Org.OData.Capabilities.V1.ChangeTracking ` gets added to entity sets that have change tracking enabled. To see annotations in entity metadata, do
25+
Before retrieving the changes for an entity, make sure that the change tracking feature is enabled for that entity. This feature can be enabled by using the customization user interface (UI) or programmatically by setting the <xref:Microsoft.Xrm.Sdk.Metadata.EntityMetadata.ChangeTrackingEnabled> property to `True`. Annotation `Org.OData.Capabilities.V1.ChangeTracking` gets added to entity sets that have change tracking enabled. To see annotations in entity metadata, do
2626

2727
```http
2828
GET [Organization URI]/api/data/v9.0/$metadata?annotations=true

0 commit comments

Comments
 (0)