MSCRM helps to connect to the Microsoft Dynamics CRM web services and perform operations on an entity. The component supports both Microsoft Dynamics CRM on-premises deployment and Microsoft Dynamics CRM Online.
Points to note
- MSCRM runs only on Windows Platform.
- MSCRM requires Microsoft .NET Framework 4.0 or above installed on the machine where peer server is running.
Configuration
Below is the MSCRM Configuration Property Sheet with the Expert Properties (for additional attributes) enabled.
Figure 1: MSCRM Configuration Property Sheet
Error Configuration
Error Handling Configuration
Details of these configurations can be referred in Error Handling section.
WSDL Configuration
Load WSDL From
Source for Organization Service WSDL can be configured here. It can be a File or a valid WSDL URL which can be found by navigating to the following location in the UI of CRM:
Settings > Customizations > Developer Resources > Service Endpoints > Organization Service
WSDL file can either be downloaded or the URL of WSDL can be found by clicking on the link of service. These details can be provided in the below options (WSDL URL and WSDL File) as they appear with respect to the selection of "URL" or "File" options respectively.
WSDL URL
Organization Service URL to be invoked. This property is visible when Load WSDL From is selected as "URL".
WSDL File
The Organization Service WSDL file location can be configured here when Load WSDL From is selected as "File".
WebService Operation
The operation to be invoked can be selected here. To select an operation, click the ellipsis button against this property. Supported operations are Create, Retrieve, Delete, Update, RetrieveMultiple, Execute, Associate, and Disassociate.
Target Namespace
Target Namespace for generated input and output schemas. This is an expert property.
Server Configuration
Authentication Type
The type of authentication used, depends on the type of deployment : Microsoft Dynamics CRM Online or Microsoft Dynamics CRM
MS CRM Server URL
The URL to the Microsoft Dynamics CRM server. The URL can be http or https and the port is optional if it is http over port 80 or https over port 443.
The server URL is typically in the format as below:
http://crm-server:port/organization-name |
And for Microsoft Dynamics CRM Online:
https://organization-name.crm.dynamics.com |
In both cases, organization name is required.
User Name
The user's identification name associated with the credentials.
Password
The password for the user name associated with the credentials.
Domain Name
The domain that will verify user credentials.
Input and Output Schema
Schemas are set on the input and output ports after finishing the CPS based on the types defined in WSDL for the operation selected.
Create
Schema structure set on the input port for Create operation is shown below and input request should confirm to this schema
Figure 2: Schema structure set on the input port for Create operation
Sample Input
Sample Input to create a new Contact entity is shown below.
Sample Output
On executing the above request, new Contact with First Name User, Last Name Name and Freight Terms FOB will be created. Here entity name must be provided in LogicalName field and the properties of entity has to be provided as key-value pairs under Attributes element. The entity name and field key name and types can be found by navigating to the following location in the UI:
Settings > Customizations > Customize the System
Under Solution explorer > Components > Entities, all the entities present in the system will be listed, On selecting the Contact entity, under Entity Definition in General tab contains Name field whose value should be provided in the LogicalName element of input xml. On selecting the Fields under Contact category, all the fields will be listed. Name of corresponding field should be provided in key-value pairs under Attributes element of input xml. Type of each field also is listed here under Type column.
Guid of the newly created entity record will be returned as output from the component as shown below.
Retrieve
This operation takes the GUID of an entity as input and retrieves an instance (record) of an entity. Either the complete fields or specific fields of the entity can be retrieved depending on the value of the field AllColumns. In order to retrieve all fields of the contact, AllColumns should be set to true. To retrieve only particular fields, AllColumns is set to false and the field key names are specified in the columns element. The guid of the entity has to specified in the id field.
To fetch UID from the Microsoft CRM server execute the following steps:
- Click on the record name on the home screen of entity in web browser.
- Click on the pop out button on the right corner of the display.
- Select id from the address bar.
Input schema of Retrieve operation is shown below, the input request must confirm with this schema.
Figure 3: Input schema of Retrieve operation
Sample Input
On executing the above request, the firstname of specified guid will be retrieved and displayed.
Sample Output
The field and the value is delivered as key value pair in the output as shown above
Retrive Multiple
Input schema of Retrieve Multiple operation is shown below, the input given must confirm with this schema.
Figure 4: Input schema of Retrieve Multiple operation
This operation is used to retrieve a collection of records. The query can be specified using Fetch XML query. The entries which satisfy all the conditions are retrieved. The fetch input XML can be generated from CRM UI as explained below.
To fetch the input XML from the CRM UI:
- In the MS CRM home page of the entity click on Advanced Find.
A new find pop-up window gets opened.
Figure 5: Advanced Find option
- Select contacts in the look for field and choose the field to be selected as the search criteria.
- Click on Download Fetch XML and save the file.
- Open the saved file to find the input XMLof fetch element
Sample Input
Enter the attribute, operation and value in the "condition" Row. Any additional attributes can also be entered in the field attribute name.
Sample Output
All the elements after matching fields with the given condition are displayed. For instance in the output above all elements with First Name = TestFirst are displayed.
Update
Input schema of update operation is shown below, the input given must confirm with this schema.
Figure 6: Input schema of update operation
Sample Input
On executing the above request, Contact with First Name, Last Name Name will be updated . Here entity name must be provided in LogicalName field and the properties of entity has to be provided as key-value pairs under Attributes element. The entity name and field key name and types can be found by navigating to the following location in the UI.
Settings -> Customizations -> Customize the System
Under Solution explorer -> Components -> Entities, all the entities present in the system will be listed, On selecting the Contact entity, under Entity Definition in General tab contains Name field whose value should be provided in the LogicalName element of input xml. On selecting the Fields under Contact category, all the fields will be listed. Name of corresponding field should be provided in key-value pairs under Attributes element of input xml. Type of each field also is listed here under Type column.
Sample Output
Delete
This operation deletes an entity. GUID of the contact to be deleted and the type of entity has to be specified by entityName.
Figure 7: Type of entity specified by entityName
Schema structure set on the input port for Delete operation is shown below and input request should confirm to this schema.
Sample Input
On executing the above request, new Contact with the given id will get deleted. Here entityName must be contact and id must be provided in the appropriate field, user id can be extracted using the steps described above.
Sample Output
Associate
This operation creates a link between two records that participate in a relationship. Relationship name has to be provided under SchemaName in the input. It can be found by navigating to the following location in the UI.
Settings -> Customizations -> Customize the System
Under Solution explorer -> Components -> Entities, all the entities present in the system will be listed, On selecting the Contact entity, and relationships tab, all the relationships for the entity are listed and schemaName can be found for each of these relationship.
Sample Input
Sample Output
Dissociate
This operation deletes link between two records. Relationship name has to be provided under SchemaName in the input. It can be found by navigating to the following location in the UI.
Settings -> Customizations -> Customize the System
Under Solution explorer -> Components -> Entities, all the entities present in the system will be listed, On selecting the Contact entity, and relationships tab, all the relationships for the entity are listed and schemaName can be found for each of these relationship.
Sample Input
Sample Output
Execute
This operation executes a message in the form of a request, and returns a response. This includes common processing like create and delete of data records and metadata, or it can be specialized processing such as import or detect duplicates. For example with the below input request, MSCRM version being used currently can be known by invoking the operation.
Sample Input
Sample Output
The current version of MSCRM is given as output in the field value. (6.0.2.50)
Functional Demonstration
Copy a user record from one CRM to another by retrieving and subsequently creating it into another MSCRM.
Figure 8: Event Process demonstrating the function of the component
Configure two components referring to the sections Retrive and Create and use the sample input shown below to retrieve a users details from one crm instance and use the same to create an entry in another crm instance using the details retrieved.
Sample Input
Sample Output
A new user is created, its GUID is output on the display.