Run a simple program using Customer Engagement web services
This topic shows you how to compile and run a program that creates an account record, retrieves the record, updates the record, and then prompts to see if you would like the record deleted.
- Download the Sample: Quick start for Microsoft Dynamics 365 for Customer Engagement apps
- You must be able to sign in to Dynamics 365 for Customer Engagement Customer Engagement.
Microsoft .NET Framework 4.6.2
Compile and run the Quick Start sample
Extract the downloaded file and open the \C#\QuickStart.csproj
Open the \C#\QuickStart.csproj file in Visual Studio.
Right click the QuickStart project in the solution explorer and select *Manage NuGet Packages...
Select the Microsoft.CrmSdk.CoreAssemblies package and update to the latest stable version.
Press F5 to compile and run the program.
Enter the following information at the prompts:
Prompt Description Enter a CRM server name and port [crm.dynamics.com] Type the name of your Dynamics 365 for Customer Engagement server. The default is Dynamics 365 for Customer Engagement (crm.dynamics.com) in North America.
Do not include the name of your organization or Internet protocol (http or https). You will be prompted for that later.
Is this server configured for Secure Sockets Layer (https) (y/n) [n] Type y if the URL you use to access Dynamics 365 (online), version 8.2 begins with https://, otherwise type n. Dynamics 365 for Customer Engagement users do not see this prompt. Is this organization provisioned in Microsoft Online Services (y/n) [n] Type y if this is a Microsoft Online Services provisioned organization. Otherwise, type n.
Only Dynamics 365 for Customer Engagement users see this prompt.
Enter domain\username For Dynamics 365 for Customer Engagement, type your network domain and user name separated by a backslash (\). For Dynamics 365 for Customer Engagement (on-premises), enter your Microsoft account.
On-premises/IFD Example: mydomain\tadams
Online Example: firstname.lastname@example.org
If you just press <Enter> for the user name, the program will look for and use saved credentials. If there are no saved credentials, the program will fail.
Enter password Type your password. The characters will show as “*” in the window. Your password is securely saved in the Microsoft Credential Manager for later reuse. Specify an organization number (1-n)  From the list of organizations shown that you belong to, type the corresponding number. The default is 1, indicating the first organization in the list. Do you want these entity records deleted? (y/n) [y] Type y for yes and n for no. After the program runs, demonstrating create, retrieve, and update of an account record, you can delete the record that was created, or you can leave it so that you can view it in the application. Press Enter to exit Press Enter to exit the program.
After running the QuickStart program or most other SDK console-based samples, the server, organization, and user name information you entered when prompted is saved in an XML configuration file for re-use the next time you run a sample. This removes the need to enter that information again as you run additional samples. After the first time, the console prompts are as follows.
|Specify the saved server configuration number (1-x) [x]:||Enter zero (0) to create a new server configuration and follow the prompts as shown in the table above. Otherwise, enter the number of a saved configuration as shown in the displayed list.|
|Enter Password:||Type your password. The characters will show as “*” in the window. If your password has been saved from a previous sample run, you will not see this prompt.|
|Do you want these entity records deleted? (y/n) [y]||Type y for yes and n for no. After the program runs, demonstrating create, retrieve and update of an account record, you can delete the record that was created, or you can leave it so that you can view it in the Web application or Dynamics 365 for Outlook.|
|Press Enter to exit||Press Enter to exit the program.|
If you would like to add or modify the functionality of this QuickStart program, you can modify the code in the CRUDOperations.cs file.
For more information about the helper code files that the QuickStart and many other SDK samples use, or to learn about how to set up a new project with the required assembly references, refer to Use the Organization Service sample and helper code. For more information about the source code that handles saving and re-using the server configuration information, see Helper Code: ServerConnection Class.
A second sample project, named QuickStart with Simplified Connection, is included in the Visual Studio solution. This second sample shows a simplified method to connect to the Dynamics 365 for Customer Engagement Organization service but is otherwise similar to the first QuickStart sample. This sample does not use any helper code to establish a web service connection.
Tutorials for Learning Dynamics 365 for Customer Engagement apps
Sample: Quick Start for Dynamics 365 for Customer Engagement
Sample: Simplified Connection Quick Start using Dynamics 365 for Customer Engagement apps
Write Code for Dynamics 365 for Customer Engagement apps
Sample Code Directory for Dynamics 365 for Customer Engagement apps
Build a .NET Business Application in 60 Minutes with xRM and SharePoint