Custom Actions in Unified Service Desk

In my previous post I discussed created custom hosted controls in USD. Now I will discuss creating custom actions for those controls. When the USD custom code runs, it calls the DoAction procedure. Within the args passed is an Action property: As can be seen from the sample code, we can check for which action is called from USD and write code accordingly: The action needs to be set up in … Continue reading Custom Actions in Unified Service Desk

Creating and Debugging a Unified Service Desk Custom Hosted Control

USD has the flexibility to create custom hosted controls. Here are the steps to do this. Download and install the Unified Service Desk templates for Visual Studio from the Microsoft website here: https://marketplace.visualstudio.com/items?itemName=DynamicsCRMPG.MicrosoftDynamicsCRMSDKTemplates Open Visual Studio. Create a new project, and under the CRM SDK Templates, select Unified Service Desk. Select UII WPF Hosted Control: This will create a project in Visual Studio like below: Expand the references. Note there are … Continue reading Creating and Debugging a Unified Service Desk Custom Hosted Control

Unified Service Desk Client

When USD is installed, by default it installs the client in the location: C:\Program Files\Microsoft Dynamics CRM USD\USD Here you will see the executable file to launch USD – UnifiedServiceDesk.exe: Opening the UnifiedServiceDesk.exe, you will firstly see the USD version screen: Followed by the login screen:  

Unified Service Desk – The Global Manager

Global Manager is a hosted control that is core to USD. When USD is started, the global manager reads all the configuration settings required to run USD. There are some events that run with Global Manager: DesktopReady SessionActivated SessionClosed SessionDeactivated SessionNew The DesktopReady event runs when USD is opened, and it runs only one time. As such, it is common to put code here to initialize the application. In CRM under USD->Events, … Continue reading Unified Service Desk – The Global Manager

Dynamics CRM Unified Service Desk Setup

Once USD has been installed (see my earlier post) the next step is to configure it. In Dynamics CRM, you can access the USD setup in Settings->Unified Service Desk: Clicking on Hosted Controls, you can see a list of the out of the box hosted controls: Let’s create a new hosted control. The control will show the start page of Dynamics CRM. Click “New” to create a new hosted control. Give … Continue reading Dynamics CRM Unified Service Desk Setup

Dynamics CRM Unified Service Desk Install

The following are steps to install the Unified Service Desk (USD). Go to the Microsoft website to download the USD files: https://www.microsoft.com/en-us/download/details.aspx?id=50355 Select files to download. I will download the 64 bit version. Note the USD version is contained in the file names, in this case 2.2.0.755: Run the package deployer. This will deploy USD to your Dynamics 365 server environment: Click continue: This will bring up the package deployer screen. … Continue reading Dynamics CRM Unified Service Desk Install

Visual Studio Snippets

In Visual Studio, code snippets are available to help with development. To use code snippets, open a Visual Studio project. Type CTRL-K then X. You will see below: You can also enter shortcut keys. For example, enter ctor and tab twice to have a constructor created: Result: Entering class and tab twice will create a class: Other often used code snippets such as try/catch, loops, etc follow the same tab … Continue reading Visual Studio Snippets

Dynamics CRM Generic SQL Error

One way a generic SQL error can occur is when dealing with ConditionOperator in QueryExpression. Consider the following code to get all users who’s first name is Bob:  QueryExpression userquery = new QueryExpression(); userquery.EntityName = “systemuser”; ColumnSet cols = new ColumnSet(); cols.AddColumn(“systemuserid”); userquery.ColumnSet = cols; ConditionExpression ce = new ConditionExpression(); ce.AttributeName = “firstname”; ce.Operator = ConditionOperator.Contains; ce.Values.Add(“Bob”); FilterExpression filter1 = new FilterExpression(); filter1.Conditions.Add(ce); userquery.Criteria.AddFilter(filter1); EntityCollection entColRoles = _orgService.RetrieveMultiple(userquery); if (entColRoles != null && … Continue reading Dynamics CRM Generic SQL Error

Dynamics 365 WhoAmI

In Dynamics 365, once we have the IOrganizationService object, we can retrieve the user id, organization id and the business unit id: CrmServiceClient conn = new CrmServiceClient(new System.Net.NetworkCredential(userid, password, domain),server, port, orgname); IOrganizationService _orgService; _orgService = (IOrganizationService)conn.OrganizationServiceProxy; Guid orgId = ((WhoAmIResponse)_orgService.Execute(new WhoAmIRequest())).OrganizationId; Guid userId = ((WhoAmIResponse)_orgService.Execute(new WhoAmIRequest())).UserId; Guid businessunitId = ((WhoAmIResponse)_orgService.Execute(new WhoAmIRequest())).UserId; Code running:

Dynamcis CRM On Premise Console App

To create a console app that connects to Dynamics CRM 2015, we will use the CrmServiceClient. Create a new Visual Studio project and add the assemblies: Microsoft.Crm.Sdk.Proxy Microsoft.Xrm.Sdk; Microsoft.Xrm.Tooling.Connector In the code, add Using: using Microsoft.Xrm.Tooling.Connector; using Microsoft.Xrm.Sdk; using Microsoft.Crm.Sdk.Messages; using Microsoft.Xrm.Sdk.Query; To connect to CRM, we will use the connection information to pass to CrmServiceClient:   string userid = “Administrator”; string password = “yourpassword”; string domain = “YOURDOMAIN”; string orgname … Continue reading Dynamcis CRM On Premise Console App