Skip to content

Commit 53e915d

Browse files
authored
Merge pull request #1391 from MicrosoftDocs/master
Pushing content live
2 parents 926f42c + d0999b1 commit 53e915d

21 files changed

+620
-582
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Information under this topic and its sub-topics is also applicable to the Dynamics 365 for Customer Engagement apps (online) users because the Customer Engagement apps are built on the Common Data Service platform. If you are Dynamics 365 for Customer Engagement apps (on-premises) user, see the documentation applicable for the on-premises functionality in the Customer Engagement documentation at:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Information in this topic is also applicable to the Dynamics 365 for Customer Engagement apps (online) users because the Customer Engagement apps are built on the Common Data Service platform. If you are Dynamics 365 for Customer Engagement apps (on-premises) user, see the documentation applicable for the on-premises functionality in the Customer Engagement documentation at

powerapps-docs/developer/common-data-service/xrm-tooling/build-windows-client-applications-xrm-tools.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Build Windows client applications using the XRM tools (Common Data Service)| Microsoft Docs"
33
description: "XRM tooling is a set of APIs that provides support for building Windows client applications for Common Data Service"
44
ms.custom: ""
5-
ms.date: 10/31/2018
5+
ms.date: 03/27/2019
66
ms.reviewer: ""
77
ms.service: powerapps
88
ms.suite: ""
@@ -13,7 +13,7 @@ applies_to:
1313
ms.assetid: e2f22576-1705-4854-a804-a1ca232c0cfc
1414
caps.latest.revision: 33
1515
author: "MattB-msft"
16-
ms.author: "kvivek"
16+
ms.author: "nabuthuk"
1717
manager: "kvivek"
1818
search.audienceType:
1919
- developer
@@ -25,13 +25,16 @@ search.app:
2525

2626
XRM tooling is a set of APIs built on top of the Common Data Service assembly APIs (Organization service and Discovery service) that provide support for building Windows client applications for Common Data Service. It provides the following capabilities:
2727

28-
- Supports all the authentication modes to sign in to Common Data Service.
29-
- Provides PowerShell support for authentication and connection to Common Data Service.
28+
- Supports all the authentication modes to sign in to Common Data Service instance.
29+
- Provides PowerShell support for authentication and connection to Common Data Service instance.
3030
- Provides thread safety for actions performed in Common Data Service in a multithreaded environment. More information [Multithreading in Components](https://msdn.microsoft.com/library/vstudio/3es4b6yy.aspx), [Thread-Safe Components](https://msdn.microsoft.com/library/vstudio/a8544e2s.aspx)
3131
- Provides a common Windows Presentation Foundation login control for Common Data Service for consistent sign-in experience to Common Data Service from your Windows client applications.
3232
- Supports secure storage of the sign-in credentials and reuse of the stored credentials to automatically sign in to Common Data Service after initial sign in.
3333
- Provides built-in diagnostic tracing and performance reporting of the actions performed in Common Data Service, which you can configure based on your organization’s requirements.
34-
34+
35+
> [!NOTE]
36+
> [!INCLUDE[cc-d365ce-note-section](../includes/cc-d365ce-note-section.md)] [Build Windows client applications using the XRM tools (Customer Engagement)](/dynamics365/customer-engagement/developer/build-windows-client-applications-xrm-tools)
37+
3538
## Components of XRM tooling
3639

3740
XRM tooling has the following three components:
@@ -48,19 +51,12 @@ The following applications in the current version of Common Data Service use the
4851

4952
- Unified Service Desk. More information: [Extend Unified Service Desk](/dynamics365/customer-engagement/unified-service-desk/extend-unified-service-desk)
5053

51-
<!-- TODO: fix links when files added to admin guide
54+
<!--Package Deployer tool. More information: [Deploy packages using Package Deployer and Windows PowerShell](../../administrator/deploy-packages-using-package-deployer-windows-powershell.md)-->
5255

53-
- Package Deployer tool. More information: [Deploy packages using Dynamics 365 Package Deployer and Windows PowerShell](../../administrator/deploy-packages-using-package-deployer-windows-powershell.md)
54-
55-
- Configuration Migration tool. More information [Manage your configuration data](../../administrator/manage-configuration-data.md)
56-
57-
-->
56+
<!--Configuration Migration tool. More information [Manage your configuration data](../../administrator/manage-configuration-data.md)-->
5857

5958
### See also
6059

6160
[Sample: Quick start for XRM Tooling API](sample-quick-start-xrm-tooling-api.md)<br />
62-
<!-- TODO:
63-
[Use the Common Data Service Organization service](use-microsoft-dynamics-365-organization-service.md)<br />
64-
[Discover the URL for Your Organization With IDiscoveryService Web Service](org-service/discover-url-organization-organization-service.md)<br />
65-
[Write Applications and Server Extensions](extend-dynamics-365-server.md)<br /> -->
66-
[Blog: PowerShell module for performing data operations and manipulating user and system settings in CRM](http://blogs.msdn.com/b/crm/archive/2015/09/25/powershell-module-for-performing-data-operations-and-manipulating-user-and-system-settings-in-crm.aspx)
61+
[Blog: PowerShell module for performing data operations and manipulating user and system settings in Common Data Service](http://blogs.msdn.com/b/crm/archive/2015/09/25/powershell-module-for-performing-data-operations-and-manipulating-user-and-system-settings-in-crm.aspx)
62+

powerapps-docs/developer/common-data-service/xrm-tooling/configure-tracing-xrm-tooling.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Configure tracing for XRM tooling (Common Data Service)| Microsoft Docs"
33
description: "Learn how you can configure tracing for components such as operation calls, warnings, exceptions, and other significant events in XRM Tooling"
44
ms.custom: ""
5-
ms.date: 10/31/2018
5+
ms.date: 03/27/2019
66
ms.reviewer: ""
77
ms.service: powerapps
88
ms.suite: ""
@@ -13,7 +13,7 @@ applies_to:
1313
ms.assetid: d7586a5a-40da-427e-bbeb-4f8a371a8dcf
1414
caps.latest.revision: 8
1515
author: "MattB-msft"
16-
ms.author: "kvivek"
16+
ms.author: "nabuthuk"
1717
manager: "kvivek"
1818
search.audienceType:
1919
- developer
@@ -28,8 +28,7 @@ You can enable tracing to record data related to process milestones across all c
2828
- A trace source
2929
- A trace listener
3030
- A trace level other than **Off**. These are the other values that you can specify: **Error**, **Warning**, **Info**, and **Verbose**.
31-
32-
Here is the configuration for enabling tracing for a component in XRM tooling. For example, the following configuration only enables tracing for the Microsoft.Xrm.Tooling.CrmConnectControl component:
31+
Here is the configuration for enabling tracing for a component in XRM tooling. For example, the following configuration only enables tracing for the Microsoft.Xrm.Tooling.CrmConnectControl component:
3332

3433
```xml
3534
</configuration>

powerapps-docs/developer/common-data-service/xrm-tooling/sample-quick-start-xrm-tooling-api.md

Lines changed: 8 additions & 218 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Sample: Quick start for XRM Tooling API (Common Data Service)| Microsoft Docs"
33
description: ""
44
ms.custom: ""
5-
ms.date: 10/31/2018
5+
ms.date: 03/27/2019
66
ms.reviewer: ""
77
ms.service: powerapps
88
ms.suite: ""
@@ -13,7 +13,7 @@ applies_to:
1313
ms.assetid: 060d45bb-b7fd-48bd-ab8f-629c1b8bc1dc
1414
caps.latest.revision: 20
1515
author: "MattB-msft"
16-
ms.author: "kvivek"
16+
ms.author: "nabuthuk"
1717
manager: "kvivek"
1818
search.audienceType:
1919
- developer
@@ -25,15 +25,14 @@ search.app:
2525

2626
The QuickStart sample is a .NET Framework managed code sample that shows how to connect to a Common Data Service instance by using the XRM Tooling APIs, and perform basic create, update, retrieve, and delete operations on an entity. For more information about XRM Tooling, see [Build windows client applications using the XRM tools](build-windows-client-applications-xrm-tools.md).
2727

28-
Download the sample: [Work with XRM Tooling API](https://code.msdn.microsoft.com/XRM-Tooling-Sample-24a5c55c)
28+
Download the sample: [Work with XRM Tooling API](https://github.com/Microsoft/PowerApps-Samples/tree/master/cds/Xrm%20Tooling/Quick%20start%20for%20XRM%20Tooling)
2929

30-
## Prerequisites
30+
## How to run the sample
3131

32-
[!INCLUDE [sdk-prerequisite](../../../includes/sdk-prerequisite.md)]
33-
34-
## Requirements
32+
1. Download and extract the sample from [here](https://github.com/Microsoft/PowerApps-Samples/tree/master/cds/Xrm%20Tooling/Quick%20start%20for%20XRM%20Tooling).
33+
1. Open the `Quick start for XRM Tooling\C#\QuickStartXRMToolingWPFClient.sln` file in Visual Studio.
34+
1. Press **F5** to compile and run the program.
3535

36-
You must have access to a Common Data Service environment.
3736

3837
## Demonstrates
3938

@@ -45,217 +44,8 @@ You must have access to a Common Data Service environment.
4544
- Login_ErrorLog.log: To report sign-in errors. This file is available at `C:\Users\`*`<username>`*`\AppData\Roaming\Microsoft\QuickStartXRMToolingWPFClient`.
4645
- QuickStartXRMToolingWPFClient.log: To report operational errors. This file is available at the same ___location as the executable, that is in the debug folder of your Visual Studio project.
4746

48-
## To run the sample
49-
50-
1. Download and extract the sample.
51-
1. Open the `Quick start for XRM Tooling\C#\QuickStartXRMToolingWPFClient.sln` file in Visual Studio.
52-
2. Press **F5** to compile and run the program.
53-
54-
## Example
55-
56-
```csharp
57-
using System;
58-
using System.Collections.Generic;
59-
using System.Linq;
60-
using System.Text;
61-
using System.Threading.Tasks;
62-
using System.Windows;
63-
using System.Windows.Controls;
64-
using System.Windows.Data;
65-
using System.Windows.Documents;
66-
using System.Windows.Input;
67-
using System.Windows.Media;
68-
using System.Windows.Media.Imaging;
69-
using System.Windows.Navigation;
70-
using System.Windows.Shapes;
71-
72-
// This namespace is automatically added for using
73-
// components in LoginWindow\CrmLogin.xaml (common login control).
74-
using QuickStartXRMToolingWPFClient.LoginWindow;
75-
76-
// Add this namespace for performing
77-
// various operations in CRM.
78-
using Microsoft.Xrm.Tooling.Connector;
79-
80-
namespace QuickStartXRMToolingWPFClient
81-
{
82-
/// <summary>
83-
/// Demonstrates how to do basic entity operations like create, retrieve,
84-
/// update, and delete using the XRM Tooling APIs and the common login
85-
/// control.</summary>
86-
/// <remarks>
87-
/// At run-time, you will be given the option to delete all the
88-
/// database records created by this program.</remarks>
89-
public partial class MainWindow : Window
90-
{
91-
public MainWindow()
92-
{
93-
InitializeComponent();
94-
btnDelete.Visibility = Visibility.Hidden;
95-
}
96-
97-
#region Class Level Members
98-
99-
private CrmLogin _ctrl = null;
100-
private Guid _accountId;
101-
102-
#endregion Class Level Members
103-
104-
#region How To Sample Code
105-
106-
/// <summary>
107-
/// Connect to Microsoft CRM, and get an instance of CRMServiceClient
108-
/// </summary>
109-
110-
private void LoginButton_Click(object sender, RoutedEventArgs e)
111-
{
112-
// Create an instance of the XRM Tooling common login control
113-
_ctrl = new CrmLogin();
114-
115-
/// Wire event to the CRM sign-in response.
116-
_ctrl.ConnectionToCrmCompleted += ctrl_ConnectionToCrmCompleted;
117-
UpdateStatus("Initiating connection to CRM...");
118-
119-
/// Show the XRM Tooling common login control.
120-
_ctrl.ShowDialog();
121-
122-
/// Validate if you are connected to CRM
123-
if (_ctrl.CrmConnectionMgr != null && _ctrl.CrmConnectionMgr.CrmSvc != null && _ctrl.CrmConnectionMgr.CrmSvc.IsReady)
124-
{
125-
UpdateStatus("Connected to CRM! (Version: " + _ctrl.CrmConnectionMgr.CrmSvc.ConnectedOrgVersion.ToString() +
126-
"; Org: " + _ctrl.CrmConnectionMgr.CrmSvc.ConnectedOrgUniqueName.ToString() + ")");
127-
UpdateStatus("***************************************");
128-
UpdateStatus("Click Start to create, retrieve, update, and delete (optional) an account record.");
129-
btnSignIn.IsEnabled = false;
130-
btnCRUD.IsEnabled = true;
131-
}
132-
// If you are not connected to CRM; display the last error and last CRM excption
133-
else
134-
{
135-
UpdateStatus("The connection to CRM failed or was cancelled by the user.");
136-
}
137-
}
138-
139-
private void btnCRUD_Click(object sender, RoutedEventArgs e)
140-
{
141-
// Create an account record
142-
Dictionary<string, CrmDataTypeWrapper> inData = new Dictionary<string, CrmDataTypeWrapper>();
143-
inData.Add("name", new CrmDataTypeWrapper("Sample Account Name", CrmFieldType.String));
144-
inData.Add("address1_city", new CrmDataTypeWrapper("Redmond", CrmFieldType.String));
145-
inData.Add("telephone1", new CrmDataTypeWrapper("555-0160", CrmFieldType.String));
146-
_accountId = _ctrl.CrmConnectionMgr.CrmSvc.CreateNewRecord("account", inData);
147-
148-
// Validate if the account is created, and then retrieve it
149-
if (_accountId != Guid.Empty)
150-
{
151-
UpdateStatus("***************************************");
152-
UpdateStatus(DateTime.Now.ToString() + ": Created an account with the following" + "\n" + "details, and retrieved it:");
153-
Dictionary<string, object> data = _ctrl.CrmConnectionMgr.CrmSvc.GetEntityDataById("account", _accountId, null);
154-
foreach (var pair in data)
155-
{
156-
if ((pair.Key == "name") || (pair.Key == "address1_city") || (pair.Key == "telephone1"))
157-
{
158-
UpdateStatus(pair.Key.ToUpper() + ": " + pair.Value);
159-
}
160-
}
161-
btnCRUD.IsEnabled = false;
162-
}
163-
else
164-
{
165-
UpdateStatus("***************************************");
166-
UpdateStatus("Could not create the account.");
167-
}
168-
169-
// Update the account record
170-
Dictionary<string, CrmDataTypeWrapper> updateData = new Dictionary<string, CrmDataTypeWrapper>();
171-
updateData.Add("name", new CrmDataTypeWrapper("Updated Sample Account Name", CrmFieldType.String));
172-
updateData.Add("address1_city", new CrmDataTypeWrapper("Boston", CrmFieldType.String));
173-
updateData.Add("telephone1", new CrmDataTypeWrapper("555-0161", CrmFieldType.String));
174-
bool updateAccountStatus = _ctrl.CrmConnectionMgr.CrmSvc.UpdateEntity("account","accountid",_accountId,updateData);
175-
176-
// Validate if the account record was updated successfully, and then display the updated information
177-
if (updateAccountStatus == true)
178-
{
179-
UpdateStatus("***************************************");
180-
UpdateStatus(DateTime.Now.ToString() + ": Updated the account details as follows:");
181-
Dictionary<string, object> data = _ctrl.CrmConnectionMgr.CrmSvc.GetEntityDataById("account", _accountId, null);
182-
foreach (var pair in data)
183-
{
184-
if ((pair.Key == "name") || (pair.Key == "address1_city") || (pair.Key == "telephone1"))
185-
{
186-
UpdateStatus(pair.Key.ToUpper() + ": " + pair.Value);
187-
}
188-
}
189-
}
190-
else
191-
{
192-
UpdateStatus("***************************************");
193-
UpdateStatus("Could not update the account.");
194-
}
195-
196-
// Prompt the user to delete the account record created in the sample
197-
UpdateStatus("***************************************");
198-
UpdateStatus("To delete the account record created by the sample, click Delete Record.");
199-
UpdateStatus("Otherwise, click Exit to close the sample application.");
200-
btnDelete.Visibility = Visibility.Visible;
201-
}
202-
203-
// Delete the account record created in this sample.
204-
private void btnDelete_Click(object sender, RoutedEventArgs e)
205-
{
206-
btnDelete.IsEnabled = false;
207-
_ctrl.CrmConnectionMgr.CrmSvc.DeleteEntity("account", _accountId);
208-
UpdateStatus("***************************************");
209-
UpdateStatus(DateTime.Now.ToString() + ": Deleted the account record.");
210-
UpdateStatus("Click Exit to close the sample application.");
211-
}
212-
213-
// Exit the sample application
214-
private void btnExit_Click(object sender, RoutedEventArgs e)
215-
{
216-
this.Close();
217-
}
218-
219-
/// <summary>
220-
/// Progressively displays the status messages about the actions
221-
/// performed during the running of the sample.
222-
/// <param name="updateText">Indicates the status string that needs to be
223-
/// displayed to the user.</param>
224-
/// </summary>
225-
public void UpdateStatus(string updateText)
226-
{
227-
if (lblStatus.Content.ToString() != String.Empty)
228-
{
229-
lblStatus.Content = lblStatus.Content + "\n" + updateText;
230-
}
231-
else
232-
{
233-
lblStatus.Content = updateText;
234-
}
235-
}
236-
237-
/// <summary>
238-
/// Raised when the login process is completed.
239-
/// </summary>
240-
private void ctrl_ConnectionToCrmCompleted(object sender, EventArgs e)
241-
{
242-
if (sender is CrmLogin)
243-
{
244-
this.Dispatcher.Invoke(() =>
245-
{
246-
((CrmLogin)sender).Close();
247-
});
248-
}
249-
}
250-
}
251-
#endregion How To Sample Code
252-
253-
}
254-
```
255-
25647
### See also
25748

25849
[Use the XRM Tooling common login control](use-xrm-tooling-common-login-control-client-applications.md)<br />
25950
[Build Windows client applications using the XRM tools](build-windows-client-applications-xrm-tools.md)<br />
260-
<!-- TODO:
261-
[Tutorials for Learning About Common Data Service Development](../tutorials-resources-sdk.md)<br /> -->
51+

0 commit comments

Comments
 (0)