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.

Threadpool Configuration

This property is used when there is a need to process messages in parallel within the component, still maintaining the sequence from the external perspective. 

Icon
  • This needs to be used only in such circumstances.
  • If sequential processing is not required, please use sessions on the input port.

Click the Threadpool Configuration ellipsis button to configure the Threadpool Configuration properties.


Figure 2: Threadpool Configuration

Enable Thread Pool

Enable this option to configure the properties that appear as below.

Pool Size

Number of requests to be processed in parallel within the component. Default value is '1'.

Batch Eviction Interval (in ms)

Time in milliseconds after which the threads are evicted in case of inactivity. New threads are created in place of evicted threads when new requests are received. Default value is '1000'.

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.

Use MetaData File?

Loads entity scheme using OData Metadata file.

The configuration properties that will be available after enabling this property are described below.


Figure 3: MetaData configuration properties

MetaData File

Provide the path to the OData Metadata file of the Instance Web API downloaded from Developer resources.

Selected Entity

Name of the entity on which operations have to be performed.

MetaData Namespace

Namespace of Metadata XML root element.

Selected Attributes

List of attributes that has to be fetched during Retrieve and RetrieveMultiple operations.

Fetch Query

To configure query to perform fetching multiple records. All the elements are part of the 'AND' clause. Multiple elements can be grouped to 'OR, 'AND' clause by selecting and/or column continuously.

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.

Domain Name

The domain that will verify user credentials.

Icon

This property is visible only when Authentication Type is "On-Premises using Active Directory"

User Name

The user's identification name associated with the credentials.

Password

The password for the user name associated with the 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 4: 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 Sample Input above, new Contact with First Name User, Last Name Name and Freight Terms FOB will be created. Here entity name must be provided in the LogicalName field and properties of the 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. Upon selecting the Contact entity, under Entity Definition in the General tab contains Name field whose value should be provided in the LogicalName element of the input XML. Upon 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 the record name on the home screen of the entity in web browser.
  • Click the 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 5: 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 6: 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:

  1. In the MS CRM home page of the entity, click the Advanced Find tab.
    A new find pop-up window gets opened.


    Figure 7: Advanced Find option
     
  2. Select contacts in the look for field and choose the field to be selected as the search criteria.
  3. Click on Download Fetch XML and save the file.
  4. 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 8: 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 the Attributes element. The entity name and the 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. Upon selecting the Contact entity, under Entity Definition in General tab contains Name field whose value should be provided in the LogicalName element of the input XML. On selecting the Fields under Contact category, all the fields will be listed. Name of the corresponding field should be provided in key-value pairs under Attributes element of the input XML. Type of each field also gets listed here under the 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 9:  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 the 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. Upon selecting the Contact entity and the relationships tab, all relationships for the entity are listed and schemaName can be found for each of these relationships.

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. Upon selecting the Contact entity and relationships tab, all 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 10: 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.

Adaptavist ThemeBuilder EngineAtlassian Confluence