Skip to content

Commit 2fe4cf1

Browse files
authored
Merge branch 'live' into live
2 parents 94ff0e9 + 4042388 commit 2fe4cf1

File tree

458 files changed

+112502
-144742
lines changed

Some content is hidden

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

458 files changed

+112502
-144742
lines changed

.openpublishing.publish.config.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,7 @@
104104
"master": [
105105
"Publish",
106106
"PDF"
107-
],
108-
"mints-Aug": [
109-
"Publish",
110-
"PDF"
111-
]
107+
]
112108
},
113109
"need_generate_pdf_url_template": true,
114110
"Targets": {

powerapps-docs/developer/common-data-service/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
href: logging-tracing.md
9090
- name: Analyze performance
9191
href: analyze-performance.md
92+
- name: Troubleshoot plug-ins
93+
href: troubleshoot-plug-in.md
9294
- name: Access external web resources
9395
href: access-web-services.md
9496
- name: Tutorials

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ We limit the number of API requests made by each user, per organization instance
2121

2222
The limit will help ensure that users running applications cannot interfere with each other based on resource constraints. The limits will not affect normal users of the platform. Only applications that perform a large number of API requests may be affected. The limit will help provide a level of protection from random and unexpected surges in request volumes that threaten the availability and performance characteristics of the Common Data Service platform.
2323

24+
Since plug-ins and custom workflow activities execute on the server independent of a logged on user, API calls made from plug-in code will not count against this external API request limit.
25+
2426
If your application has the potential to exceed the limit, please consider the guidance given in the [What should I do if my application exceeds the limit?](#what-should-i-do-if-my-application-exceeds-the-limit) section below.
2527

2628
## What happens when the limit is exceeded?

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ In the following table:
8080
|Categorization|`StateType`<br />[StateAttributeMetadata](/dotnet/api/microsoft.xrm.sdk.metadata.stateattributemetadata)|No|Contains the option value that describes the status of an entity record.<br />More information: [Option Sets](#option-sets)|
8181
|Categorization|`StatusType`<br />[StatusAttributeMetadata](/dotnet/api/microsoft.xrm.sdk.metadata.statusattributemetadata)|No|Contains the option value that describes the reason for the status of an entity record.<br />More information: [Option Sets](#option-sets)|
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.|
83-
|Collection|`PartyListType`|No|Contains a collection of `ActivityParty` entity records.<br />More information: [ActivityParty entity](#activityparty-entity)|
83+
|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.|
8585
|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)|
8686
|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)|
Loading
Loading

powerapps-docs/developer/common-data-service/org-service/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@
104104
href: metadata-retrieve-detect-changes.md
105105
- name: Retrieve, update, and delete entities
106106
href: metadata-retrieve-update-delete-entities.md
107+
- name: Create an entity to send email activities
108+
href: create-update-entity-emailed.md
107109
- name: Import data
108110
href: ../import-data.md #Topic is for both Web API and Organization service
109111
- name: Sample data
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: "Create and update an entity to send email activities to records (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
3+
description: "Learn about creating an entity that contains an email address you can use to send email activities to records for that entity." # 115-145 characters including spaces. This abstract displays in the search result.
4+
ms.custom: ""
5+
ms.date: 04/05/2019
6+
ms.reviewer: ""
7+
ms.service: powerapps
8+
ms.topic: "article"
9+
author: "brandonsimons" # GitHub ID
10+
ms.author: "jdaly" # MSFT alias of Microsoft employees only
11+
manager: "ryjones" # MSFT alias of manager or PM counterpart
12+
search.audienceType:
13+
- developer
14+
search.app:
15+
- PowerApps
16+
- D365CE
17+
---
18+
# Create and update an entity to send email activities to records
19+
20+
You can create an entity that contains an email address you can use to send email activities to records for that entity.
21+
22+
The following sample code creates a custom entity and sets the <xref:Microsoft.Xrm.Sdk.Metadata.EntityMetadata.IsActivityParty> property to `true`. It also creates a <xref:Microsoft.Xrm.Sdk.Metadata.StringAttributeMetadata> attribute using <xref:Microsoft.Xrm.Sdk.Metadata.StringFormatName>.`Email` to provide an email address to use.
23+
24+
Even if you add other <xref:Microsoft.Xrm.Sdk.Metadata.StringAttributeMetadata> attributes formatted as an email address, only the first one specified is used.
25+
26+
```csharp
27+
// Create the custom entity.
28+
CreateEntityRequest createrequest = new CreateEntityRequest
29+
{
30+
// Define an entity to enable for emailing. In order to do so,
31+
// IsActivityParty must be set.
32+
Entity = new EntityMetadata
33+
{
34+
SchemaName = _customEntityName,
35+
DisplayName = new Label("Agent", 1033),
36+
DisplayCollectionName = new Label("Agents", 1033),
37+
Description = new Label("Insurance Agents", 1033),
38+
OwnershipType = OwnershipTypes.UserOwned,
39+
IsActivity = false,
40+
41+
// Unless this flag is set, this entity cannot be party to an
42+
// activity.
43+
IsActivityParty = true
44+
},
45+
46+
// As with built-in emailable entities, the Primary Attribute will
47+
// be used in the activity party screens. Be sure to choose descriptive
48+
// attributes.
49+
PrimaryAttribute = new StringAttributeMetadata
50+
{
51+
SchemaName = "new_fullname",
52+
RequiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None),
53+
MaxLength = 100,
54+
FormatName = StringFormatName.Text,
55+
DisplayName = new Label("Agent Name", 1033),
56+
Description = new Label("Agent Name", 1033)
57+
}
58+
};
59+
60+
_serviceProxy.Execute(createrequest);
61+
Console.WriteLine("The emailable entity has been created.");
62+
63+
// The entity will not be selectable as an activity party until its customizations
64+
// have been published. Otherwise, the e-mail activity dialog cannot find
65+
// a correct default view.
66+
PublishAllXmlRequest publishRequest = new PublishAllXmlRequest();
67+
_serviceProxy.Execute(publishRequest);
68+
69+
// Before any emails can be created for this entity, an Email attribute
70+
// must be defined.
71+
CreateAttributeRequest createFirstEmailAttributeRequest = new CreateAttributeRequest
72+
{
73+
EntityName = _customEntityName,
74+
Attribute = new StringAttributeMetadata
75+
{
76+
SchemaName = "new_emailaddress",
77+
RequiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None),
78+
MaxLength = 100,
79+
FormatName = StringFormatName.Email,
80+
DisplayName = new Label("Email Address", 1033),
81+
Description = new Label("Email Address", 1033)
82+
}
83+
};
84+
85+
_serviceProxy.Execute(createFirstEmailAttributeRequest);
86+
Console.WriteLine("An email attribute has been added to the emailable entity.");
87+
88+
// Create a second, alternate email address. Since there is already one
89+
// email attribute on the entity, this will never be used for emailing
90+
// even if the first one is not populated.
91+
CreateAttributeRequest createSecondEmailAttributeRequest = new CreateAttributeRequest
92+
{
93+
EntityName = _customEntityName,
94+
Attribute = new StringAttributeMetadata
95+
{
96+
SchemaName = "new_secondaryaddress",
97+
RequiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None),
98+
MaxLength = 100,
99+
FormatName = StringFormatName.Email,
100+
DisplayName = new Label("Secondary Email Address", 1033),
101+
Description = new Label("Secondary Email Address", 1033)
102+
}
103+
};
104+
105+
_serviceProxy.Execute(createSecondEmailAttributeRequest);
106+
107+
Console.WriteLine("A second email attribute has been added to the emailable entity.");
108+
```
109+
110+
### See Also
111+
112+
[Create entities using the Organization Service](entity-operations-create.md)
113+
[Update and Delete entities using the Organization Service](entity-operations-update-delete.md)

powerapps-docs/developer/common-data-service/org-service/entity-operations-update-delete.md

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Update and Delete entities using the Organization Service (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
33
description: "Learn how to update and delete entities using the organization service." # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.custom: ""
5-
ms.date: 10/31/2018
5+
ms.date: 04/21/2019
66
ms.reviewer: ""
77
ms.service: powerapps
88
ms.topic: "article"
@@ -17,16 +17,6 @@ search.app:
1717
---
1818
# Update and Delete entities using the Organization Service
1919

20-
<!--
21-
Adding parity with Web API topics
22-
23-
include information from https://docs.microsoft.com/dynamics365/customer-engagement/developer/org-service/perform-specialized-operations-using-update
24-
25-
https://docs.microsoft.com/dynamics365/customer-engagement/developer/org-service/use-early-bound-entity-classes-create-update-delete
26-
https://docs.microsoft.com/dynamics365/customer-engagement/developer/org-service/manage-duplicate-detection-create-update
27-
28-
-->
29-
3020
This topic will include examples using both late-bound and early-bound programming styles. More information: [Early-bound and Late-bound programming using the Organization service](early-bound-programming.md)
3121

3222
Each of the examples uses a `svc` variable that represents an instance of a class that implements the methods in the <xref:Microsoft.Xrm.Sdk.IOrganizationService> interface. For information about the classes that support this interface see [IOrganizationService Interface](iorganizationservice-interface.md).
@@ -37,14 +27,21 @@ Each of the examples uses a `svc` variable that represents an instance of a clas
3727
> You should create a new entity instance, set the id attribute and any attribute values you are changing, and use that entity instance to update the record.
3828
3929
> [!NOTE]
40-
> The metadata for attributes includes a `RequiredLevel` property. When this is set to `SystemRequired`, you cannot set these attributes to a null value. More information: [Attribute requirement level](../entity-attribute-metadata.md#attribute-requirement-level)
30+
> The metadata for attributes includes a `RequiredLevel` property. When this is set to `SystemRequired`, you cannot set these attributes to a null value. If you attempt this you will get error code `-2147220989` with the message `Attribute: <attribute name> cannot be set to NULL`.
31+
>
32+
> More information: [Attribute requirement level](../entity-attribute-metadata.md#attribute-requirement-level)
4133
4234
## Basic update
4335

4436
Both of the examples below uses the <xref:Microsoft.Xrm.Sdk.IOrganizationService>.<xref:Microsoft.Xrm.Sdk.IOrganizationService.Update*> method to set attribute values for an entity that was previously retrieved.
4537

4638
Use the <xref:Microsoft.Xrm.Sdk.Entity>.<xref:Microsoft.Xrm.Sdk.Entity.Id> property to transfer the unique identifier value of the retrieved entity to the entity instance used to perform the update operation.
4739

40+
> [!NOTE]
41+
> If you attempt to update a record without a primary key value you will get the error: `Entity Id must be specified for Update`.
42+
>
43+
> If you don't have a primary key value, you can also update records using alternate keys. More information: [Update with Alternate Key](#update-with-alternate-key)
44+
4845
### Late-bound example
4946

5047
The following example shows using the <xref:Microsoft.Xrm.Sdk.Entity> class to create an account record using the <xref:Microsoft.Xrm.Sdk.IOrganizationService>.<xref:Microsoft.Xrm.Sdk.IOrganizationService.Update*> method.
@@ -223,6 +220,30 @@ svc.Update(account);
223220

224221
When updating an entity you may change the values so that the record represents a duplicate of another record. More information: [Detect duplicate data using the Organization service](detect-duplicate-data.md)
225222

223+
## Update with Alternate Key
224+
225+
If you have an alternate key defined for an entity, you can use that in place of the primary key to update a record. You cannot use the early-bound class to specify the alternate key. You must use the [Entity(String, KeyAttributeCollection)](/dotnet/api/microsoft.xrm.sdk.entity.-ctor#Microsoft_Xrm_Sdk_Entity__ctor_System_String_Microsoft_Xrm_Sdk_KeyAttributeCollection_) constructor to specify the alternate key.
226+
227+
If you want to use early bound types, you can convert the <xref:Microsoft.Xrm.Sdk.Entity> to an early bound class using the <xref:Microsoft.Xrm.Sdk.Entity.ToEntity``1> method.
228+
229+
The following example shows how to update an `Account` entity using an alternate key defined for the `accountnumber` attribute.
230+
231+
> [!IMPORTANT]
232+
> By default there are no alternate keys defined for any entities. This method can only be used when the environment is configured to define an alternate key for an entity.
233+
234+
```csharp
235+
var accountNumberKey = new KeyAttributeCollection();
236+
accountNumberKey.Add(new KeyValuePair<string, object>("accountnumber", "123456"));
237+
238+
Account exampleAccount = new Entity("account", accountNumberKey).ToEntity<Account>();
239+
exampleAccount.Name = "New Account Name";
240+
svc.Update(exampleAccount);
241+
```
242+
243+
More information:
244+
- [Work with alternate keys](../define-alternate-keys-entity.md)
245+
- [Use an alternate key to create a record](../use-alternate-key-create-record.md)
246+
226247
## Use Upsert
227248

228249
Typically in data integration scenarios you will need to create or update data in Common Data Service from other sources. Common Data Service may already have records with the same unique identifier, which may be an alternate key. If an entity record exists, you want to update it. If it doesn't exist, you want to create it so that the data being added is synchronized with the source data. This is when you want to use upsert.
@@ -370,5 +391,4 @@ More information: [Behavior of specialized update operations](../special-update-
370391

371392
[Create entities using the Organization Service](entity-operations-create.md)<br />
372393
[Retrieve an entity using the Organization Service](entity-operations-retrieve.md)<br />
373-
[Associate and disassociate entities using the Organization Service](entity-operations-associate-disassociate.md)<br />
374-
394+
[Associate and disassociate entities using the Organization Service](entity-operations-associate-disassociate.md)<br />

0 commit comments

Comments
 (0)