Skip to content

Commit 7d1accd

Browse files
authored
Merge branch 'live' into patch-2
2 parents 80df6f0 + aa9f78c commit 7d1accd

File tree

179 files changed

+2655
-545
lines changed

Some content is hidden

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

179 files changed

+2655
-545
lines changed

powerapps-docs/developer/common-data-service/authenticate-oauth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ To add a password:
312312

313313
#### Common Data Service user account bound to the registered app
314314

315-
The first thing you must do is create a custom security role that will define what access and privileges this account will have within the Common Data Service organization. More information: [Create or configure a custom security role](https://docs.microsoft.com/power-platform/admin/database-security.md#create-or-configure-a-custom-security-role)
315+
The first thing you must do is create a custom security role that will define what access and privileges this account will have within the Common Data Service organization. More information: [Create or configure a custom security role](/power-platform/admin/database-security#create-or-configure-a-custom-security-role).
316316

317317
After you have created the custom security role, you must create the user account which will use it.
318318

powerapps-docs/developer/common-data-service/logging-tracing.md

Lines changed: 41 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Logging and tracing (Common Data Service) | Microsoft Docs"
33
description: "Use the trace log to store plug-in execution information to aid in plug-in debugging."
44
ms.custom: ""
5-
ms.date: 1/28/2019
5+
ms.date: 05/05/2019
66
ms.reviewer: ""
77
ms.service: powerapps
88
ms.topic: "article"
@@ -17,97 +17,82 @@ search.app:
1717
---
1818
# Tracing and logging
1919

20-
An alternative method to troubleshoot a plug-in or custom workflow activity (custom code), compared to debugging in [!INCLUDE[pn_Visual_Studio](../../includes/pn-visual-studio.md)], is to use tracing. Tracing assists developers by recording run-time custom information as an aid in diagnosing the cause of code failures. Tracing is especially useful to troubleshoot [!INCLUDE[pn_CRM_Online](../../includes/pn-crm-online.md)] registered custom code as it is the only supported troubleshooting method for that scenario. Tracing is supported for sandboxed (partial trust) and full trust registered custom code and during synchronous or asynchronous execution. Tracing isn’t supported for custom code that executes in [!INCLUDE[pn_microsoft_dynamics_crm_for_outlook](../../includes/pn-microsoft-dynamics-crm-for-outlook.md)] or other mobile client.
20+
Use tracing to troubleshoot a plug-in or custom workflow activity (custom code). Tracing assists developers by recording run-time information as an aid in diagnosing the cause of code failures. Tracing is supported for synchronous or asynchronous execution.
2121

22-
Recording of run-time tracing information for [!INCLUDE[pn_dynamics_crm](../../includes/pn-dynamics-crm.md)] apps is provided by a service named <xref:Microsoft.Xrm.Sdk.ITracingService>. Information provided to this service by custom code can be recorded in three different places as identified here.
23-
24-
> [!NOTE]
25-
> Trace logging using `ITracingService` interface works only when the Plug-in is registered in Sandbox mode.
22+
Recording of run-time tracing information for Common Data Service is provided by a service named <xref:Microsoft.Xrm.Sdk.ITracingService>. Information provided to this service by custom code can be recorded in three different places as identified here.
2623

2724
- **Trace log**
2825

29-
Trace log records of type **PluginTraceLog** can be found in the web application by navigating to **Settings** and choosing the **Plug-in Trace Log** tile. The tile is only visible if you have access to the trace log entity records in your assigned security role. Writing of these records is controlled by the trace settings mentioned in the next section.
30-
31-
> [!NOTE]
26+
Trace log records are written to the [PluginTraceLog Entity](reference/entities/plugintracelog.md). Writing of these records is controlled by the trace settings mentioned in [Enable trace logging](#enable-trace-logging).
27+
28+
This data can be found in model-driven applications by navigating to **Settings** and choosing the **Plug-in Trace Log** tile. The tile is only visible if you have access to the trace log entity records in your assigned security role.
29+
30+
You may find it easier to view this data by using the Web API in your browser using the example shown in [Use Tracing](debug-plug-in.md#use-tracing) or by using the [Plug-in trace viewer](#plug-in-trace-viewer) community tool.
31+
32+
> [!IMPORTANT]
3233
> Trace logging takes up organization storage space especially when many traces and exceptions are generated. You should only turn trace logging on for debugging and troubleshooting, and turn it off after your investigation is completed.
3334
3435
- **Error dialog**
3536

36-
A synchronous registered plug-in or custom workflow activity that returns an exception back to the platform results in an error dialog box in the web application presented to the logged on user. The user may select the **Download Log File** button in the dialog to view the log containing exception and trace output.
37+
A synchronous registered plug-in or custom workflow activity that returns an exception from the platform results in an error dialog box in the web application presented to the logged on user. The user may select the **Download Log File** button in the dialog to view the log containing exception and trace output.
3738

3839
- **System job**
3940

4041
For asynchronous registered plug-in or custom workflow activities that returns an exception, the tracing information is shown in the **Details** area of the **System Job** form in the web application.
4142

42-
<a name="bkmk_trace-settings"></a>
43-
## Enable trace logging
44-
To enable trace logging in an organization that supports this feature, in the web application navigate to **Settings** > **Administration** > **System Settings**. In the **Customization** tab, locate the drop-down menu labeled **Enable logging to plug-in trace log** and select one of the available options.
45-
46-
|Option|Description|
47-
|------------|-----------------|
48-
|Off|Writing to the trace log is disabled. No **PluginTraceLog** records will be created. However, custom code can still call the <xref:Microsoft.Xrm.Sdk.ITracingService.Trace(System.String,System.Object[])> method even though no log is written.|
49-
|Exceptions|Trace information is written to the log if an exception is passed back to the platform from custom code.|
50-
|All|Trace information is written to the log upon code completion or an exception is passed back to the platform from the custom code.|
51-
52-
If the trace logging setting is set to **Exception** and your custom code returns an exception back to the platform, a trace log record is created and tracing information is also written to one other ___location. For custom code that executes synchronously, the information is presented to the user in an error dialog box, otherwise, for asynchronous code, the information is written to the related system job.
43+
<a name="bkmk_trace-settings"></a>
44+
45+
## Enable trace logging
46+
47+
Whether trace logs will be written depends on the value of the [Organization](/powerapps/developer/common-data-service/reference/entities/organization) Entity [PluginTraceLogSetting](/powerapps/developer/common-data-service/reference/entities/organization#BKMK_PluginTraceLogSetting) attribute value.
48+
49+
To enable trace logging you can programmatically update this value or in the web application navigate to **Settings** > **Administration** > **System Settings**. In the **Customization** tab, locate the drop-down menu labeled **Enable logging to plug-in trace log** and select one of the available options.
5350

54-
By default, the System Administrator and System Customizer roles have the required privileges to change the trace logging setting, which is stored in a <xref:Microsoft.Xrm.Sdk.Deployment.TraceSettings> entity record. Trace settings have an organization scope.
51+
|Value|Option|Description|
52+
|------------|-----------------|-----------------|
53+
|0|Off|Writing to the trace log is disabled. No **PluginTraceLog** records will be created. However, custom code can still call the <xref:Microsoft.Xrm.Sdk.ITracingService.Trace(System.String,System.Object[])> method even though no log is written.|
54+
|1|Exceptions|Trace information is written to the log if an exception is passed back to the platform from custom code.|
55+
|2|All|Trace information is written to the log upon code completion or an exception is passed back to the platform from the custom code.|
5556

56-
## Write to the tracing service
57-
Before writing to the tracing service, you must first extract the tracing service object from the passed execution context. Afterwards, simply add <xref:Microsoft.Xrm.Sdk.ITracingService.Trace(System.String,System.Object[])> calls to your custom code where appropriate passing any relevant diagnostic information in that method call.
57+
If the trace logging setting is set to **Exception** and your custom code returns an exception back to the platform, a trace log record is created and tracing information is also written to one other ___location. For custom code that executes synchronously, the information is presented to the user in an error dialog box, otherwise, for asynchronous code, the information is written to the related system job.
58+
59+
## Write to the tracing service
60+
61+
Before writing to the tracing service, you must first extract the tracing service object from the passed execution context. Afterwards, simply add <xref:Microsoft.Xrm.Sdk.ITracingService.Trace(System.String,System.Object[])> calls to your custom code where appropriate passing any relevant diagnostic information in that method call.
5862

59-
Download the sample: [Work with plug-ins](https://code.msdn.microsoft.com/Sample-Create-a-basic-plug-64d86ade).
6063

6164
```csharp
62-
//Extract the tracing service for use in debugging sandboxed plug-ins.
65+
//Extract the tracing service for use in debugging plug-ins.
6366
ITracingService tracingService =
6467
(ITracingService)serviceProvider.GetService(typeof(ITracingService));
6568

66-
// Obtain the execution context from the service provider.
67-
IPluginExecutionContext context = (IPluginExecutionContext)
68-
serviceProvider.GetService(typeof(IPluginExecutionContext));
69-
70-
// For this sample, execute the plug-in code only while the client is online.
71-
tracingService.Trace("AdvancedPlugin: Verifying the client is not offline.");
72-
if (context.IsExecutingOffline || context.IsOfflinePlayback)
73-
return;
74-
75-
// The InputParameters collection contains all the data passed
76-
// in the message request.
77-
if (context.InputParameters.Contains("Target") &&
78-
context.InputParameters["Target"] is Entity)
79-
{
80-
// Obtain the target entity from the Input Parameters.
81-
tracingService.Trace
82-
("AdvancedPlugin: Getting the target entity from Input Parameters.");
83-
Entity entity = (Entity)context.InputParameters["Target"];
84-
85-
// Obtain the image entity from the Pre Entity Images.
86-
tracingService.Trace
87-
("AdvancedPlugin: Getting image entity from PreEntityImages.");
88-
Entity image = (Entity)context.PreEntityImages["Target"];
69+
// Use the tracing service
70+
tracingService.Trace("Write your message here.");
71+
8972
```
9073

91-
92-
Next, build and deploy the plug-in or custom workflow activity. During execution of the custom code, the information provided in the **Trace** method calls is written to a trace log entity record by <xref:Microsoft.Xrm.Sdk.ITracingService>, if supported by your organization and enabled, and may also be made available to the user in a Web dialog or system job as described in the previous section. Tracing information written to the trace log is configured in the trace settings. For more information see [Enable trace logging](#bkmk_trace-settings).
74+
Next, build and deploy the plug-in or custom workflow activity. During execution of the custom code, the information provided in the **Trace** method calls is written to a trace log entity record by <xref:Microsoft.Xrm.Sdk.ITracingService>, if supported by your organization and enabled, and may also be made available to the user in a Web dialog or system job as described in the previous section. Tracing information written to the trace log is configured in the trace settings. For more information see [Enable trace logging](#bkmk_trace-settings).
9375

9476
> [!NOTE]
95-
> If your custom code executes within a database transaction, and an exception occurs that causes a transaction rollback, all entity data changes by your code will be undone. However, the **PluginTraceLog** records will remain after the rollback completes.
77+
> If your custom code executes within a database transaction, and an exception occurs that causes a transaction rollback, all entity data changes by your code will be undone. However, the [PluginTraceLog](reference/entities/plugintracelog.md) records will remain after the rollback completes.
9678
9779
## Additional information about the tracing service
9880

99-
The <xref:Microsoft.Xrm.Sdk.ITracingService> batches the information provided to it through the **Trace** method. The information is written to a new **PluginTraceLog** record after the custom code successfully runs to completion or an exception is thrown.
81+
The <xref:Microsoft.Xrm.Sdk.ITracingService> batches the information provided to it through the **Trace** method. The information is written to a new [PluginTraceLog](reference/entities/plugintracelog.md) record after the custom code successfully runs to completion or an exception is thrown.
10082

101-
PluginTraceLog records have a finite lifetime. A bulk deletion background job runs once per day to delete records that are older than 24 hours from creation. This job can be disabled when needed.
83+
[PluginTraceLog](reference/entities/plugintracelog.md) records have a finite lifetime. A bulk deletion background job runs once per day to delete records that are older than 24 hours from creation.
84+
85+
> [!CAUTION]
86+
> While this job can be disabled or the frequency in which it occurs can be adjusted, failure to set it back to the original setting is frequently discovered to be the cause of performance issues later on.
10287
10388
## Community tools
10489

10590
### Plug-in trace viewer
10691

107-
**Plugin Trace Viewer** is a tool that XrmToolbox community developed for [!INCLUDE[pn_dynamics_crm](../../includes/pn-dynamics-crm.md)] apps. Please see the [Developer tools](developer-tools.md) topic for community developed tools.
92+
**Plugin Trace Viewer** is a tool that XrmToolbox community developed. Please see the [Developer tools](developer-tools.md) topic for community developed tools.
10893

10994
> [!NOTE]
110-
> The community tools are not a product of [!include[pn_microsoft_dynamics](../../includes/pn-microsoft-dynamics.md)] apps and does not extend support to the community tools.
95+
> The community tools are not a product of Microsoft and does not extend support to the community tools.
11196
> If you have questions pertaining to the tool, please contact the publisher. More Information: [XrmToolBox](https://www.xrmtoolbox.com).
11297
11398
### See also

powerapps-docs/developer/common-data-service/org-service/create-client-app.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Create Client applications(Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
33
description: "<Description>" # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.custom: ""
5-
ms.date: 10/31/2018
5+
ms.date: 05/20/2019
66
ms.reviewer: ""
77
ms.service: powerapps
88
ms.topic: "article"
@@ -17,6 +17,7 @@ search.app:
1717
---
1818
# Create a client application
1919

20+
Content coming soon...
2021
<!--
2122
2223
New page to be the focus for the tasks surrounding discovery service and authentication to create a client application for the organization service.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Use change tracking to synchronize data with external systems (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
3-
description: "The change tracking feature in Dynamics 365 Customer Engagement provides a way to keep the data synchronized in a performant way by detecting what data has changed since the data was initially extracted or last synchronized" # 115-145 characters including spaces. This abstract displays in the search result.
3+
description: "The change tracking feature in Dynamics 365 Customer Engagement provides a way to keep the data synchronized in an efficient manner by detecting what data has changed since the data was initially extracted or last synchronized" # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.custom: ""
55
ms.date: 10/31/2018
66
ms.reviewer: ""
@@ -17,7 +17,7 @@ search.app:
1717
---
1818
# Use change tracking to synchronize data with external systems
1919

20-
The change tracking feature in Common Data Service provides a way to keep the data synchronized in a performant way by detecting what data has changed since the data was initially extracted or last synchronized. Previously, without this new feature, it was difficult to build a reliable and efficient mechanism to determine what records had changed in Common Data Service. This topic discusses how to retrieve changes for an entity.
20+
The change tracking feature in Common Data Service provides a way to keep the data synchronized in an efficient manner by detecting what data has changed since the data was initially extracted or last synchronized. Previously, without this new feature, it was difficult to build a reliable and efficient mechanism to determine what records had changed in Common Data Service. This topic discusses how to retrieve changes for an entity.
2121

2222
<a name="BKMK_enable"></a>
2323
## Enable change tracking for an entity

0 commit comments

Comments
 (0)