HomeGuidesRecipesAPI
HomeGuidesAPILog In
Guides
These docs are for v10. Click to read the latest docs for v31.

Microsoft Dynamics 365 Connector

The MS Dynamics 365 Connector has been developed to provide an integrated experience for customers by integrating Infiniti with MS Dynamics 365. This Infiniti Connectors for Dynamics 365 includes several integration components which support Data Sources to pull data from Dynamics to consume in Infiniti forms and Actions which provide functionality to push data from Infiniti forms to MS Dynamics 365.

With the launch of Infiniti version 10, a newer version of MS Dynamics Connector has also been released to roll out exciting new features and enhancements for designers. Here's a guide to what's changed and how to install the new MS Dynamics 365 Extension to get started using the new features. This article will also provide a walkthrough on how to upgrade from your current MS Dynamics 365 Connector to the new version-10-compatible MS Dynamics 365 Extension.

What's New

  • Dynamics Create Email Activity

The new Dynamics Create Email Activity Action lets you track and manage email communications with customers. You can now create the email activity and include Infiniti generated documents as attachments.

  • Dynamics Set State Request

The new Dynamics Set State Request Action lets you set the state of an entity record. An entity's Status Code and State Code attribute can now be updated from Infiniti.

  • Dynamics Data Source Custom Display Fields

The Dynamics 365 Data Source now support Display Fields concatenation to satisfy the need of having a custom Display Field.

  • New Naming Conventions

We’re changing the way we name this connector to make things simpler and to unify our approach for Microsoft Dynamics 365. Going forward all components of the extension will have a "Dynamics" prefix instead of "xRM".

  • Access offline data on mobile apps

The connector setting "Use cached data [true|false]" is no longer be part of the connector as it is obsolete. Inifniti now allows data sources to be cached in order for the data to be available on mobile apps even when offline. See How to access offline data on mobile apps for more details.

Extension Components

Action

  • Dynamics Create Entity Action
  • Dynamics Update Entity Action
  • Dynamics Create Relationship Action
  • Dynamics Create Connection Action
  • Dynamics Create Email Activity Action
  • Dynamics Set State Request Action

Data Source

  • Dynamics 365

👍

Understanding Dynamics Data model

A useful resource for information about your MS Dynamics 365 environment can be found in the Customizations area of Dynamics, accessed from Settings > Customizations > Customize the System. This provides a view of all components in your MS Dynamics 365 environment, including Entities, Relationships, Fields and Option Sets that can be extremely useful in configuring both the Data Source and Actions for MS Dynamics 365 within the Infiniti system.

Upgrade/Installation Requirements

Before installing or upgrading this extension you must consider the following requirements:

  • You must have administrator/elevated permissions to the Infiniti web server, including the ability to copy and replace files in the Infiniti installation folder. This is usually c:\inetpub\wwwroot\infiniti however may vary from system to system.

  • You must have the following installation files:

  • Dynamics365Extension.dll

  • Microsoft.Crm.Sdk.Proxy.dll

  • Microsoft.IdentityModel.Clients.ActiveDirectory.dll

  • Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll

  • Microsoft.Xrm.Sdk.Deployment.dll

  • Microsoft.Xrm.Sdk.dll

  • Microsoft.Xrm.Sdk.Workflow.dll

  • Microsoft.Xrm.Tooling.Connector.dll

  • Ensure you have a compatible version of the connector with your current Infiniti version (Connector and Infiniti should match versions)

❗️

Licence key required

To enable the MS Dynamics 365 module you will require a licence. If you don't have one please contact your Sales Representative or email us at [email protected]

👍

Remember

Changes to the configuration may cause interruptions to users in forms.
Before installing or upgrading this Connector in a production Infiniti environment, ensure the environment is backed up.
It is recommended that this installation or upgrade is tested in a non-production environment first, and installed/upgraded during scheduled downtime.

Installing the Connector

Use the instructions below to install the connector. If you are upgrading the connector from a previous version, refer to the section Upgrading the Connector below.

Note that [Infiniti Produce Path] refers to the installation path on the web server running Infiniti, where the Produce site has been installed. By default this is c:\inetpub\wwwroot\infiniti\produce however path may vary from environment to environment. Equally, [Infiniti Manage Path] refers to where the Manage site has been installed, and [IntelledoxScheduler Path] refers to the where the Intelledox Scheduler service has been installed.

How to install the Dynamics Connector

  1. Copy the files listed above into the following folder on the Infiniti web server:
    [Infiniti Produce Path]\bin
  2. Using a text editor such as Notepad, open the following file:
    [Infiniti Produce Path]\appsettings.json

📘

Note

Ensure you have elevated privileges when opening the web.config file, otherwise you may not be able to save in the current folder.

  1. Locate the <Extensions> section of the appsettings.json file and add the following entries:
"Dynamics365Extension.CreateEntityAction, Dynamics365Extension",
"Dynamics365Extension.UpdateEntityAction, Dynamics365Extension",
"Dynamics365Extension.CreateConnectionAction, Dynamics365Extension",
"Dynamics365Extension.CreateRelationshipAction, Dynamics365Extension",
"Dynamics365Extension.CreateEmailActivityAction, Dynamics365Extension",
"Dynamics365Extension.SetStateRequestAction, Dynamics365Extension",
"Intelledox.Datasource.LegacyDatasource`1[[Dynamics365Extension.DynamicsDataProvider, Dynamics365Extension]], Intelledox.Datasource"
  1. Locate the "LegacyDatasources" property or create it if it doesn't exist, and add the following:
"LegacyDatasources": {
  "Dynamics365Extension.DynamicsDataProvider, Dynamics365Extension": {
    "name": "Dynamics 365"
  }
}

Produce appsettings.json file should look like:

{
  "Extensions": [
    "Intelledox.Extension.DatasourceBuiltin.OleDbDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.SqlServerDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.CsvDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.OdbcDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.RSSDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.WebserviceDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.XmlDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.InfinitiDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.JsonDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.RestDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.ActionBuiltin.FileAction, Intelledox.Extension.ActionBuiltin",
    "Intelledox.Extension.ActionBuiltin.SQLServerAction, Intelledox.Extension.ActionBuiltin",
    "Intelledox.Extension.ActionBuiltin.DownloadPageMessageAction, Intelledox.Extension.ActionBuiltin",
    "Intelledox.Extension.ActionBuiltin.RedirectAction, Intelledox.Extension.ActionBuiltin",
    "Intelledox.Extension.ActionBuiltin.EmailAction, Intelledox.Extension.ActionBuiltin",
    "Intelledox.Extension.ActionBuiltin.PrintAction, Intelledox.Extension.ActionBuiltin",
    "Intelledox.Extension.ActionBuiltin.UserAction, Intelledox.Extension.ActionBuiltin",
    "Intelledox.Extension.ActionBuiltin.WebhookAction, Intelledox.Extension.ActionBuiltin",
    "Intelledox.Extension.ActionBuiltin.RESTAction, Intelledox.Extension.ActionBuiltin",
    "Intelledox.Extension.ActionBuiltin.OracleAction, Intelledox.Extension.ActionBuiltin",
    "Intelledox.Extension.ActionBuiltin.PushNotificationAction, Intelledox.Extension.ActionBuiltin",
    "Intelledox.Extension.EscalationBuiltin.EmailEscalation, Intelledox.Extension.EscalationBuiltin",
    "Intelledox.Extension.EscalationBuiltin.ReassignmentEscalation, Intelledox.Extension.EscalationBuiltin",
    "Intelledox.Extension.EscalationBuiltin.PushNotificationEscalation, Intelledox.Extension.EscalationBuiltin", 
    
    "Dynamics365Extension.CreateEntityAction, Dynamics365Extension",
    "Dynamics365Extension.UpdateEntityAction, Dynamics365Extension",
    "Dynamics365Extension.CreateConnectionAction, Dynamics365Extension",
    "Dynamics365Extension.CreateRelationshipAction, Dynamics365Extension",
    "Dynamics365Extension.CreateEmailActivityAction, Dynamics365Extension",
    "Dynamics365Extension.SetStateRequestAction, Dynamics365Extension",
   "Intelledox.Datasource.LegacyDatasource`1[[Dynamics365Extension.DynamicsDataProvider, Dynamics365Extension]], Intelledox.Datasource"
  ],
  "Authentication": {
    "Settings": {
      "CookiePrefix": "infiniti",
      "Timeout": "30"
    }
  },
  "LegacyDatasources": {
    "Dynamics365Extension.DynamicsDataProvider, Dynamics365Extension": {
      "name": "Dynamics 365"
    }
	}
}

A similar process has to be done to configure Dynamics data source in manage.

  1. Copy the files listed above into the following folder on the Infiniti web server:
    [Infiniti Manage Path]\bin
  2. Using a text editor such as Notepad, open the following file:
    [Infiniti Manage Path]\appsettings.json and add the below line in Extensions.
"Intelledox.Datasource.LegacyDatasource`1[[Dynamics365Extension.DynamicsDataProvider, Dynamics365Extension]], Intelledox.Datasource"
  1. Locate the "LegacyDatasources" property or create it if it doesn't exist, and add the following:
"LegacyDatasources": {
    "Dynamics365Extension.DynamicsDataProvider, Dynamics365Extension": {
      "name": "Dynamics 365"
    }
}

Manage appsettings.json file should look like:

{
  "Extensions": [
    "Intelledox.Extension.DatasourceBuiltin.OleDbDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.SqlServerDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.CsvDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.OdbcDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.RSSDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.WebserviceDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.XmlDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.InfinitiDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.JsonDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Extension.DatasourceBuiltin.RestDatasource, Intelledox.Extension.DatasourceBuiltin",
    "Intelledox.Datasource.LegacyDatasource`1[[Dynamics365Extension.DynamicsDataProvider, Dynamics365Extension]], Intelledox.Datasource"
  ],
  "AppSettings": {},
  "Authentication": {
    "Settings": {
      "CookiePrefix": "infiniti",
      "Timeout": "30"
    }
  },
    "LegacyDatasources": {
    "Dynamics365Extension.DynamicsDataProvider, Dynamics365Extension": {
      "name": "Dynamics 365"
    }
	},
  "Styles": {
    "Well": {
      "appliesto": "question,layout",
      "class": "well"
    },
    "Jumbotron": {
      "appliesto": "question,layout",
      "class": "jumbotron"
    },
    "Alert (success)": {
      "appliesto": "question,layout",
      "class": "alert alert-success"
    },
    "Alert (info)": {
      "appliesto": "question,layout",
      "class": "alert alert-info"
    },
    "Alert (warning)": {
      "appliesto": "question,layout",
      "class": "alert alert-warning"
    },
    "Alert (error)": {
      "appliesto": "question,layout",
      "class": "alert alert-danger"
    },
    "Label (default)": {
      "appliesto": "question",
      "class": "labelIx label-default"
    },
    "Label (primary)": {
      "appliesto": "question",
      "class": "labelIx label-primary"
    },
    "Label (success)": {
      "appliesto": "question",
      "class": "labelIx label-success"
    },
    "Label (info)": {
      "appliesto": "question",
      "class": "labelIx label-info"
    },
    "Label (warning)": {
      "appliesto": "question",
      "class": "labelIx label-warning"
    },
    "Label (error)": {
      "appliesto": "question",
      "class": "labelIx label-danger"
    }
  }
}

Using a web browser, navigate to the Infiniti Produce and Infiniti Manage applications to allow the system to register the Connector.

📘

Info

Always access Produce after installing the connector. This will register the connector in the Infiniti database.

The Microsoft Dynamics Extension should now be installed ready for configuration and usage.

Upgrading the Connector

This section will guide you through the process of upgrading an existing MS Dynamics 365 Connector to the new MS Dynamics 365 Extension in Infiniti version 10.

  1. Make sure you remove all files of the current MS Dynamics 365 Connector from your Infiniti web server.

1.1 Navigate to your [Infiniti Produce Path]\bin folder, then remove these following files:

  • MicrosoftDynamicsConnector.dll
  • Microsoft.Crm.Sdk.Proxy.dll
  • Microsoft.IdentityModel.Clients.ActiveDirectory.dll
  • Microsoft.Xrm.Sdk.dll
  • Microsoft.Xrm.Sdk.Deployment.dll
  • Microsoft.Xrm.Tooling.Connector.dll

1.2 Perform the same step to your [Infiniti Manage Path]\bin folder, remove all the files listed above.

  1. Copy the new MS Dynamics 365 Extension files into your Infiniti web server.

2.1 Copy the files listed in Upgrade/Installation Requirements section (these files should be found in upgrade pack’s “bin” folder) into your [Infiniti Produce Path]\bin folder:

  • Dynamics365Extension.dll
  • Microsoft.Crm.Sdk.Proxy.dll
  • Microsoft.IdentityModel.Clients.ActiveDirectory.dll
  • Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
  • Microsoft.Xrm.Sdk.Deployment.dll
  • Microsoft.Xrm.Sdk.dll
  • Microsoft.Xrm.Sdk.Workflow.dll
  • Microsoft.Xrm.Tooling.Connector.dll

2.2 Repeat the same step with your Manage, copy all the files listed above into your [Infiniti Manage Path]\bin folder

  1. Update configuration settings for the new MS Dynamics 365 Actions.

3.1 Using a text editor such as Notepad, open the following file:
[Infiniti Produce Path]\appsettings.json

3.2 Locate the <Extensions> section of the appsettings.json file and remove the following entries:

"Intelledox.Action.LegacyAction`1[[MicrosoftDynamicsConnector.xRMCreateEntityActionProvider, MicrosoftDynamicsConnector]], Intelledox.Action",
"Intelledox.Action.LegacyAction`1[[MicrosoftDynamicsConnector.xRMCreateConnectionActionProvider, MicrosoftDynamicsConnector]], Intelledox.Action",
"Intelledox.Action.LegacyAction`1[[MicrosoftDynamicsConnector.xRMUpdateEntityActionProvider, MicrosoftDynamicsConnector]], Intelledox.Action",
"Intelledox.Action.LegacyAction`1[[MicrosoftDynamicsConnector.xRMCreateRelationActionProvider, MicrosoftDynamicsConnector]], Intelledox.Action"

3.3 Locate the <Extensions> section of the appsettings.json file, this time add these following entries:

"Dynamics365Extension.CreateEntityAction, Dynamics365Extension",
"Dynamics365Extension.UpdateEntityAction, Dynamics365Extension",
"Dynamics365Extension.CreateConnectionAction, Dynamics365Extension",
"Dynamics365Extension.CreateRelationshipAction, Dynamics365Extension",
"Dynamics365Extension.CreateEmailActivityAction, Dynamics365Extension",
"Dynamics365Extension.SetStateRequestAction, Dynamics365Extension"
  1. Update configuration settings for the new MS Dynamics 365 Data Source.

4.1 Using a text editor such as Notepad, open the following file:
[Infiniti Manage Path]\appsettings.json

4.2 Locate the <Extensions> section of the appsettings.json file and remove the following entry:

"Intelledox.Datasource.LegacyDatasource`1[[MicrosoftDynamicsConnector.xRMDataProvider, MicrosoftDynamicsConnector]], Intelledox.Datasource"

4.3 Locate the <Extensions> section of the appsettings.json file, this time add this following entry

"Intelledox.Datasource.LegacyDatasource`1[[Dynamics365Extension.DynamicsDataProvider, Dynamics365Extension]], Intelledox.Datasource"

4.4 Locate the "LegacyDatasources" property of the appsettings.json file and only change the line "MicrosoftDynamicsConnector.xRMDataProvider, MicrosoftDynamicsConnector" into "Dynamics365Extension.DynamicsDataProvider, Dynamics365Extension". The "name" attribute in this "LegacyDatasources" property should remain as it is.

🚧

Important Note

For the upgrade to be successful, the “name” attribute of your Microsoft Dynamics Legacy Data Source should remain the same to the name you were having in Infiniti version 9 (before the connector upgrade).

4.5 Repeat from Step 4.2 to Step 4.4 with your [Infiniti Produce Path]\appsettings.json

  1. Using a web browser, navigate to the Infiniti Produce and Infiniti Manage applications to allow the system to upgrade the Connector.

Installation to Intelledox Scheduler

If the target environment is using the Intelledox Scheduler, it is best practice to always install connectors and accelerators to this service at the same time as the installation in Infiniti Produce application. If this is not installed to the Intelledox Scheduler there may be errors if any projects are executed from the scheduler that refers to this connector.

To install any connector to the Intelledox Scheduler, follow the instructions in this guide as they apply to Infiniti Produce, except instead of [Infiniti Produce Path] use [IntelledoxScheduler Path], noting that there is no ‘bin’ folder in this path so all files should be copied into the root of this path. For example, consider the path:
c:\inetpub\wwwroot\infiniti\produce\bin

To install to the Intelledox Scheduler, simply use this path:

c:\inetpub\wwwroot\infiniti\intelledoxscheduler

Also, you must apply the same configuration changes as instructed for the Produce appsettings.json file.

Configuring the Connector Settings

The Dynamics Connector exposes a number of connector settings which provide system-wide values to control behaviour or context. In many cases, these settings can be overridden when the action is used in a project.

How to view or modify connector settings

  1. In a web browser, navigate to the Infiniti Manage application and log in.
  2. Navigate to Settings and then click the Connector Settings button at the top of the page.
  3. Using the Connector drop-down list, select the ‘Dynamics Create Entity’ option.
  4. Review and update the settings as required. The settings are described in the table below.
  5. Click the Save button at the top of the page.
1917
SettingDescription
Dynamics Connection StringURL to the Dynamics followed by authentication type.
For example:
Url=https://o365account.crm6.dynamics.com;authtype=Office365

See Dynamics Connection String section for more details.
Force Impersonate [true|false]By default, this option is set to false. If you set this option to true then username can be passed in the connector actions with which a new record would be created or existing record would be updated in Dynamics.
Suppress duplicate detection [True|False]By default, this option is set to false. If this is set to false than duplicate detection will be activated during Dynamics Create Entity action.
Update duplicate on create [True|False]By default, this option is set to false. If this option is set to true then Infiniti will look for any record in Dynamics with the same values that are being passed in Dynamics Create Entity action and if such record exists, the existing record would be updated instead of creating a new record in Dynamics.
Debug Mode [true|false]If the debug mode is set to true, the detailed logs will be shown in the Management tab in Manage.

📘

Note

Connector Settings are applied system-wide, for specific scenarios where it is required to use different credentials, please specify them in Dynamics action in Design or directly in the Data Source configuration.

Dynamics Connection String

Infiniti enables you to connect to your MS Dynamics 365 instance by using connection strings. This is similar to the concept of connection strings used with Microsoft SQL Server.

You supply this connection string in the Connection String section when you set up your Dynamics 365 Data Source, as shown in the following example.

1350

Connection String can also be supplied at Action level. All the MS Dynamics 365 Actions have an attribute CRM Connection String. If you provide the value of your connection string in the action for this attribute, the action will use the connection string configured in the actions else it will use the connection string configured above in Manage->Settings tab.

Connection String Parameters

Parameter NameDescription
Url (mandatory)Specifies the URL to the MS Dynamics 365 Server. The URL can use http or https protocol, and the port is optional.
AuthType (mandatory)Specifies the authentication type to connect to Dynamics 365 instance. Valid value for Dynamics 365 (online) instances is Office365.
UserName (mandatory)Specifies the user's identification name associated with the credentials.
Password (mandatory)Specifies the password for the user name associated with the credentials.
DomainSpecifies the domain that will verify user credentials.
RequireNewInstanceThe default value of this parameter is set to false. If your are having multiple conenctions to multiple MS Dynamics 365 instances, set this to true to force the system to create a unique connection instance.

👍

Best Practice:

You can specify the username and password in the Connection String but it is best practice to specify the username and password in the credentials section so that no one can access them. This will provide additional security as the password is masked.

Example of Connection String attribute configured in the data source.

Url=https://o365account.crm6.dynamics.com;authtype=Office365

Dynamics Data Source

The MS Dynamics 365 Data Source for Infiniti is used to read data from MS Dynamics
365 environment.

This is useful for bringing back entity records, such as contacts, to populate drop-down
lists in an Infiniti web form, or to populate a web form with the specific entity
information from MS Dynamics 365. It can also be used to make decisions dynamically based on
data in MS Dynamics 365, for example, based on the contact type in MS Dynamics 365 you may wish to ask additional questions in the web form.

The data source can also be used to automatically fill entity data in generated
document outputs from Infiniti, such as Word or PDF documents, emails and other
communications.

You can easily read data from multiple related entity records and can add as many
data questions to an Infiniti project as needed. You can also read data from custom
entity types you may have added to your MS Dynamics 365 environment.

The MS Dynamics 365 Data Source also allows you to read data from Option Sets in your MS Dynamics 365 environment. This is often useful for automatically populating drop-down lists in the
Infiniti form for user selection.

Configure Dynamics Data Source

  • In a web browser navigate to the Infiniti Manage application and log in if prompted. Then navigate to the Data Sources page.
  • Click the New Data Source button, and complete the connection information as the following.
AttributeDescription
Data Source NameType a name for the data source.
Connection TypeSelect Dynamics 365 from the drop-down list.
Connection StringUrl=; (set username and password including optional domain in ‘Credentials’ area below);Domain=;

See Dynamics Connection String section for more details.
1350
  • Click Save to save the details provided, and Test Connection to confirm it can connect successfully to your MS Dynamics 365 environment.
  • Click on Data Objects button to add a new data object.
  • Start typing the entity name in the Data Object Name/Definition field. The matching entities will get populated in a drop-down list and select a particular entity.
  • Type a name in the Display Name field for this data object.
  • Select the required Available Fields and click on Add.
1351
  1. Now the above-configured Dynamics data source can be used in the project by adding a Data Source - Question Type to the page as any data source.

👍

Best Practice

It is best practice to specify the fields of an entity which are to be pulled from Dynamics.

For example, you can specify the contact [contactid|firstname|lastname|telephone1|emailaddress1|address1_line1|address1_line2|address1_line3] in the Data Object Name / Definition and this data source will only pull the data from specified fields from Dynamics. This will enhance the performance.

Configure Custom Display Fields for Dynamics Data Source

A custom display field for Dynamics Data Source can be defined in the Data Object Definition using the following syntax:

entityname [fieldname|ConcatField:static text {fieldname} {fieldname}]

Example 1: Suppose we want to create a custom display field of Contact entity called FullNameFormatted, which is a combination of firstname and lastname under this format: firstname,lastname. Along with FullNameFormatted, we also want to display contactid in our Data Source, the Data Object Definition should look like this:

contact [contactid|FullNameFormatted:{lastname}, {firstname}]
820

Notice in the result we now have contactid, firstname, lastname and FullNameFormatted displayed:

1659

Example 2: Suppose we want to create a custom display field of Account entity called AccountNameFormatted, which is a concatenation of name value and the word "Account". Along with AccountNameFormatted, we also want to display accountid in our Data Source, the Data Object Definition should look like this:

account [accountid|AccountNameFormatted:{name} Account]
814

Notice in the result we now have accountid, AccountNameFormatted, and namedisplayed:

1657

MS Dynamics 365 Actions

While the action providers are installed, they will not be called until a project is set up in Infiniti with one or more of the MS Dynamics 365 actions, with action attributes that instruct the action providers on how to behave.

Action attributes can be set up with fixed values within Design, or they can be set up to refer to values collected via the question set during the generation process.

1365

Adding a MS Dynamics 365 Action

  1. Open an existing project in Design.
  2. Drag a new action onto the Finish Page. The action can be either ‘Dynamics Create Entity’, ‘Dynamics Update Entity’, ‘Dynamics Create Relationship’ or 'Dynamics Create Connection'.
  3. Set the action attributes as described in the below action section, depending on the specific action selected.
  4. Save your project, and test in Produce.

👍

Best Practice:

While the name of the action defaults to the action name i.e. ‘Dynamics Create Entity’ for Create Entity action, the name should be modified as per the functionality of that particular action. For example, in the below screenshot the 'xRM Create Entity' action is renamed to 'Create Application Contact'.

1367

Dynamics Create Entity Action

Infiniti Actions are executed when an Infiniti form is submitted, either when transitioning from one workflow step to the next, or submission of a completed form. The xRM Create Entity action is used to create a new record of data in MS Dynamics 365 based on data submitted by the user.

For example, after collecting the user’s information you may add them to MS Dynamics 365 using the contact entity type. This will create a record in contact entity with the provided data.

You can add multiple Create Entity actions in your project to create multiple records in the different entities in Dynamics.

Using the Action in Design

Once you’ve added the xRM Create Entity action to your project, either on the Finish page or a workflow transition, use the following table to configure any action attributes that you require.

Action Attributes

NameDescription
Attach Documents [true|false]Set to ‘true’ if you wish to attach documents to the entity, usually within an annotation. If you leave this attribute out, the default is ‘false’.
Note that only the documents passed to the action are used for attachments. This can be configured on the Documents tab when the action is selected.
Attachment Relationship NameSpecify the name of the relationship to create an annotation for the chosen entity. This is typically in the form of entitytype_Annotation.
For example, for accounts, this would be ‘Account_Annotation’. To find the relationship name in the customization area of Dynamics, look in the 1:N Relationships node under the required entity node.
Entity Properties [1 per line]Add each field you wish to set in the new entity record on a separate line within this attribute value, in the form of field name=value. Note that you may include question references or fixed values after the equals (=) sign.
xRM EntityEnter the type of entity where the record would is to be created, e.g. ‘contact’.
CRM ConnectionStringIf the connection string is not provided in the action, Infiniti will use the connection string configured in Settings->Connector Settings for this connector.

You can also use the datasource name within the curly braces as the connection string value. In this case when action will be executed the datasource name will be replaced by the actual connection string configured for this data source in Manage during the runtime.

For example, we have configured the datasource 'DynamicsConnector' so we can use the {DynamicsConnector} as the value for this attribute.
Impersonate UsernameThe username which will be used to create a record in the Dynamics entity.
Dynamics should supports impersonation in order to use this functionality.
Suppress duplicate detection [True|False]If this parameter is not passed in the action, then the value configured for this attribute in Setting->Connector Settings for the Dynamics Connector will be used.
By default, this option is set to false. If this is set to false than duplicate detection will be activated during xRM Create Entity action.
Update duplicate on create [True|False]If this parameter is not passed in the action, then the value configured for this attribute in Setting->Connector Settings for the Dynamics Connector will be used.
By default, this option is set to false. If this option is set to true then Infiniti will look for any record in Dynamics with the same values that are being passed in xRM Create Entity action and if such record exists, the existing record would be updated instead of creating a new record in Dynamics.
Attachment properties [1 per line]

📘

Info

xRM Entity and Entity Properties [1 per line] are the only mandatory attributes for this action.

The below screenshot shows this action where only three action attributes (xRM Entity, CRM Connection String, and Entity Properties [1 per line] are configured.

1367

Action Outputs

xRM Create Entity action has the following two outputs:

  • Entity Id: This is the GUID of the newly created record in the specified entity.
  • Is Duplicate:

You can reference this returned Entity Id in the subsequent actions. For example, you can use this ID in the Display Message action to inform the user that a record with the returned GUID is created in Dynamics.

To reference the ID in the action attribute of the subsequent action, use the reference notation of [action name.Entity Id]. For example, in the below screenshot we are referencing the output Entity ID of Create Application Contact in the Display Message Action.

1362

Dynamics Update Entity Action

Similar to the Create Entity Action, the Update Entity Action is run when an Infiniti form is submitted, either during workflow transitions or at the end of the completed form, and updates an existing MS Dynamics 365 entity record.

This can be used in conjunction with the other Actions for more complex interactions with MS Dynamics 365.

For example, you may wish to update a contact entity record prior to relating that contact as a primary contact on a new entity record.

Using the Action in Design

Once you’ve added the Dynamics Update Entity action to your project, either on the Finish page or a workflow transition, use the following table to configure any action attributes that you require.

Action Attributes

NameDescription
Attach Documents [true|false]Set to ‘true’ if you wish to attach documents to the entity, usually within an annotation. If you leave this attribute out, the default is ‘false’.
Note that only the documents passed to the action are used for attachments. This can be configured on the Documents tab when the action is selected.
Attachment Relationship NameSpecify the name of the relationship to create an annotation for the chosen entity. This is typically in the form of entitytype_Annotation.
Entity IDEnter the unique ID of the entity record to be updated. For example, for accounts this would be the ‘accountid’ field.
Note: see Action Outputs below for information about referencing the entity ID created by the xRM Create Entity Action.
Entity Properties [1 per line]Add each field you wish to update in the entity record on a separate line within this attribute value, in the form of field name=value. Note that you may include question references or fixed values after the equals (=) sign.
xRM EntityEnter the type of entity to be updated, e.g. ‘account’.
CRM ConnectionStringIIf the connection string is not provided in the action, Infiniti will use the connection string configured in Settings->Connector Settings for this connector.

You can also use the datasource name within the curly braces as the connection string value. In this case when action will be executed the datasource name will be replaced by the actual connection string configured for this data source in Manage during the runtime.

For example, we have configured the datasource 'DynamicsConnector' so we can use the {DynamicsConnector} as the value for this attribute. .
Attachment properties [1 per line]
Impersonate UsernameThe username which will be used to create a record in the Dynamics entity.
Dynamics should supports impersonation in order to use this functionality.

📘

Info

xRM Entity, Entity ID, and Entity Properties [1 per line] are the only mandatory attributes for this action.

In the below screenshot, we are updating a record in the entity 'contact'. The ID of the record that is to be updated is retrieved from the data source 'Contact Entity' in the 'contactid' answer field. The answer field is referenced in the Entity ID attribute of the xRM Update Entity action.

1365

Dynamics Create Relationship Action

The xRM Create Relationship action is used to relate two entities in MS Dynamics 365 and can be used in conjunction with the Create Entity action to create a relationship with a newly created entity.

For example, your form may collect information to create a new contact entity and you wish to add the contact to an existing account entity. Just remember that any actions you add to the Infiniti project run in the order placed, so when creating relationships and new entities, you must always create the new entities first.

Using the Action in Design

Once you’ve added the xRM Create Relationship action to your project, either on the Finish page or a workflow transition, use the following table to configure any action attributes that you require.

Action Attributes

NameDescription
Child Entity IdEnter the unique ID of the entity record to be the child in this relationship. For example, for accounts this would be the ‘accountid’ field.
Note: see Action Outputs below for information about referencing the entity ID created by the xRM Create Entity Action.
Child Entity TypeEnter the type of entity to be the parent record in the relationship, e.g. ‘account’.
Parent Entity IdEnter the unique ID of the entity record to be the parent in this relationship. For example, for contacts this would be the ‘contactid’ field.
Note: see Action Outputs below for information about referencing the entity ID created by the xRM Create Entity Action.
Parent Entity TypeEnter the type of entity to be the parent record
Relationship Type NameSpecify the name of the relationship type used to relate the child entity to the parent entity.
To find the relationship name in the customization area of Dynamics, look under the required entity at one of the following sub-nodes:
1:N Relationships
N:1 Relationships
* N:N Relationships
CRM ConnectionStringIf the connection string is not provided in the action, Infiniti will use the connection string configured in Settings->Connector Settings for this connector.

You can also use the datasource name within the curly braces as the connection string value. In this case when action will be executed the datasource name will be replaced by the actual connection string configured for this data source in Manage during the runtime.

For example, we have configured the datasource 'DynamicsConnector' so we can use the {DynamicsConnector} as the value for this attribute.

Dynamics Create Connection Action

The xRM Create Connection action can be used to create an association between two records present in MS Dynamics 365 entities. You have to specify the entities name and GUID of the records which are to be associated.

Using the Action in Design

Once you’ve added the xRM Create Connection action to your project, either on the Finish page or a workflow transition, use the following table to configure any action attributes that you require.

Action Attributes

NameDescription
Entity1NameEnter the name of the first entity.
e.g. Contact
Entity2NameEnter the name of the second entity.
Entity1IdEnter the unique ID of the entity record of the first entity.
Entity2IdEnter the unique ID of the second entity.
Entity1RoleIdEnter the unique ID of the connection role for the first entity.
Entity2RoleIdEnter the unique ID of the connection role for the second entity.
CRM ConnectionStringIf the connection string is not provided in the action, Infiniti will use the connection string configured in Settings->Connector Settings for this connector.

You can also use the datasource name within the curly braces as the connection string value. In this case when action will be executed the datasource name will be replaced by the actual connection string configured for this data source in Manage during the runtime.

For example, we have configured the datasource 'DynamicsConnector' so we can use the {DynamicsConnector} as the value for this attribute.

Dynamics Create Email Activity Action

The Dynamics Create Email Activity Action is used to create the email activity against a record in MS Dynamics 365 and include Infiniti generated documents as attachments

Using the Action in Design

Once you’ve added the Dynamics Create Email Activity Action action to your project, either on the Finish page or a workflow transition, use the following table to configure any action attributes that you require.

Action Attributes

NameDescription
Related to Entity IdEnter the unique ID of the entity record the email activity should be created against. For example, for accounts this would be the ‘accountid’ field.
Note: see Action Outputs section for information about referencing the entity ID created by the Dynamics Create Entity Action.
Related to Entity NameEnter the type of entity the email activity should be created against, e.g. ‘account’.
Entity State Code [statecode property]Enter the State Code of the generated Email activity.
Entity Status Code [statuscode property]Enter the Status Code of the generated Email activity.
From - one id or email address per lineEmails will appear to have originated from this address.
To - one id or email address per lineEmails will be sent to this email address.
SubjectThis will be the subject of the email.
CC - one id or email address per lineEmails can be carbon copied to this email address.
BCC - one id or email address per lineEmails can be blind carbon copied to this email address.
BodyThis will populate the body of the email.
Direction of Email [inward|outward]Select the direction of the email as incoming or outbound.
Include Attachments [true|false]By default, this option is set to false. If this is set to true then Infiniti generated documents will be sent as attachments.
CRM Connection StringIf the connection string is not provided in the action, Infiniti will use the connection string configured in Settings->Connector Settings for this connector.
You can also use the datasource name within the curly braces as the connection string value. In this case when action will be executed the datasource name will be replaced by the actual connection string configured for this data source in Manage during the runtime.
For example, we have configured the datasource 'DynamicsConnector' so we can use the {DynamicsConnector} as the value for this attribute.

The below screenshot shows how this action is configured in Infiniti Design

1915

New email entities will be created in Dynamics in a Draft state.

To send the email one method is to configure Dynamics as follows:

  1. Create a boolean field with a suitable name eg: "Email Trigger Send"
  2. Create a workflow which is triggered by the update of the "Email Trigger Send" field to change the status of the email activity to "Pending Send" and the number of send attempts to 0 (which will trigger Dynamics to do the send)
  3. In Infiniti, after the Create Email Activity action, add an Update Entity Action to change the "Email Trigger Send" to yes/true.

Dynamics Set State Request Action

The Dynamics Set State Request Action is used to update an entity's Status Code and State Code attribute.

Using the Action in Design

Once you’ve added the Dynamics Set State Request Action action to your project, either on the Finish page or a workflow transition, use the following table to configure any action attributes that you require.

Action Attributes

NameDescription
Entity IdEnter the unique ID of the entity record to be updated. For example, for accounts this would be the ‘accountid’ field.
Note: see Action Outputs section for information about referencing the entity ID created by the xRM Create Entity Action.
Entity NameEnter the type of entity to be updated, e.g. ‘account’.
Entity State Code [statecode property]Enter the State Code of the you entity record you would like to be updated.
Entity Status Code [statuscode property]Enter the Status Code of the you entity record you would like to be updated.
CRM Connection StringIf the connection string is not provided in the action, Infiniti will use the connection string configured in Settings->Connector Settings for this connector.
You can also use the datasource name within the curly braces as the connection string value. In this case when action will be executed the datasource name will be replaced by the actual connection string configured for this data source in Manage during the runtime.
For example, we have configured the datasource 'DynamicsConnector' so we can use the {DynamicsConnector} as the value for this attribute.

The below screenshot shows how this action is configured in Infiniti Design.

1913

Troubleshooting

MS Dynamics 365 connections can fail due to a number of reasons. Some of the common issues for failure include:

  • Invalid connection strings
  • Data integrity issues in passed data in actions. For an example not passing mandatory fields when creating an entity.
  • Network issues between Infiniti server and the Dynamics instance.

👍

Best Practice

Whenever you are debugging, make sure that you have set the Debug Mode [true|false] to true in the connector settings in Manage. This will result in detailed logging of the action execution.

The first place to investigate is the Management tab of Infiniti Mange if you encounter issues when using the dynamics connector. You will see the record for your execution.
For example, in the below screenshot you can see a project 'Testing Dynamics Connection' is executed by user 'admin' and the status is 'Completed'.

1348

If you want to see the logs for this execution, Click on the View field. Once you click on 'View' you will see the logs for this execution as shown in the below screenshot. You will see the Level as 'Warning' for error. Refer to the Description to know the reason for this error.

1350