HomeGuidesRecipesAPI
HomeGuidesAPILog In

Dynamics 365 Actions

❗️

Contact your sales representative if you are interested in obtaining a license for the Microsoft Dynamics Connector Module for your SmartIQ environment.

All actions default to the action name, i.e. ‘Dynamics Create Entity’ for Create Entity action, this should be modified as per the functionality of that particular action. For example, the 'Create Entity' action could be renamed to 'Create Application Contact'.

Dynamics Create Entity Action

SmartIQ Actions are executed when a SmartIQ form is submitted, either when transitioning from one workflow step to the next, or submission of a completed form.

The Dynamics 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 also add multiple Create Entity actions in your project to create multiple records in the different entities in Dynamics.

In Design, once you’ve added the Dynamics Create Entity action to your project, either on the Finish page or a workflow transition, use the Dynamics Create Entity Action Attributes table to configure any action inputs that you require.

InputDescription
Annotation properties [1 per line]Attachment metadata for documents.
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]
(Mandatory)
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.

If the attribute value is of type MultiSelect Option Set, enclose the list of integer values in square brackets eg: fieldname=[1,2,3,5.9]

Most attribute values cannot be set to an empty value. Any attempt to set a value to a blank value such as fieldname= will be ignored by the connector.
To set entity properties of type string to an empty string value, you must use the special value {null} eg: fieldname={null}
Entity
(Mandatory)
Enter the type of entity where the record is to be created, e.g. ‘contact’.
CRM Connection StringIf the connection string is not provided in the action, SmartIQ will use the connection string configured in Settings > Dynamics 365 Connector for this connector.

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

For example, we have configured the data connection '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 support 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 Settings > Dynamics 365 Connector will be used.

By default, this option is set to false. If this is set to false. the duplicate detection will be activated during the Create Entity action.
Transaction ModeIf true, submit the action as part of a batched transaction along with other Dynamics actions for the same submission. If false, the action runs individually.
Update duplicate on create [True|False]If this parameter is not passed in the action, then the value configured for this attribute in Settings > Dynamics 365 Connector will be used.

By default, this option is set to false. If this option is set to true then SmartIQ will look for any record in Dynamics with the same values that are being passed in the Create Entity action. If such record exists, the existing record would be updated instead of creating a new record in Dynamics.

Action Outputs

Dynamics Create Entity Action has the following outputs:

  • Entity Id - This is the GUID of the newly created record in the specified entity.
    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.
  • Is Duplicate - Returns a true or false if it is a duplicate.

To reference the ID in the action attribute of the subsequent action, use the reference tag [action name.Entity Id].

Dynamics Update Entity Action

Similar to the Create Entity Action, the Update Entity Action is run when an SmartIQ 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.

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 Dynamics Update Entity Action Attributes table to configure any action attributes that you require.

InputDescription
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 ID
(Mandatory)
Enter the unique ID of the entity record to be updated. For example, for accounts, this would be the ‘accountid’ field.

Refer to Action Outputs for information about referencing the entity ID created by the Create Entity Action.
Entity Properties [1 per line]
(Mandatory)
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.

If the attribute value is of type MultiSelect Option Set enclose the list of integer values in square brackets eg: fieldname=[1,2,3,5.9]

Most attribute values cannot be set to an empty value. Any attempt to set a value to a blank value such as fieldname= will be ignored by the connector.
To set entity properties of type string to an empty string value you must use the special value {null} eg: fieldname={null}
Entity
(Mandatory)
Enter the type of entity to be updated, e.g. ‘account’.
CRM Connection StringIf the connection string is not provided in the action, SmartIQ will use the connection string configured in Settings > Dynamics 365 Connector for this connector.

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

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

Dynamics should support impersonation in order to use this functionality.
Transaction ModeIf true, submit the action as part of a batched transaction along with other Dynamics actions for the same submission. If false, the action runs individually.

Dynamics Create Relationship Action

The 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 may wish to add the contact to an existing account entity. Just remember that any actions you add to the SmartIQ project run in the order placed, so when creating relationships and new entities, you must always create the new entities first.

In Design, once you’ve added the Create Relationship action to your project, use the Dynamics Create Relationship Action Attributes table either on the Finish page or a workflow transition to configure any action attributes that you require.

InputDescription
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. Refer to Action Outputs for information about referencing the entity ID created by the 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. Refer to Action Outputs for information about referencing the entity ID created by the 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 Connection StringIf the connection string is not provided in the action, SmartIQ will use the connection string configured in Settings > Dynamics 365 Connector for this connector. You can also use the data connection name within the curly braces as the connection string value. In this case, when the action is executed the data connection name will be replaced by the actual connection string configured for this data connection in Manage during runtime. For example, we have configured the data connection 'DynamicsConnector' so we can use the {DynamicsConnector} as the value for this attribute.

Dynamics Create Connection Action

The 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.

In Design, once you’ve added the Create Connection action to your project, either on the Finish page or a workflow transition, use the Dynamics Create Connection Action Attributes table to configure any action attributes that you require.

InputDescription
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 Connection StringIf the connection string is not provided in the action, SmartIQ will use the connection string configured in Settings > Dynamics 365 Connector for this connector.

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

For example, we have configured the data connection '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 SmartIQ generated documents as attachments.

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

InputDescription
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.

Refer to Action Outputs 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 SmartIQ generated documents will be sent as attachments.
CRM Connection StringIf the connection string is not provided in the action, SmartIQ will use the connection string configured in Settings > Dynamics 365 Connector for this connector.

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

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

New email entities will be created in Dynamics in a Draft state. To send the email, configure Dynamics as follows:

  1. Create a boolean field with a suitable name like "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 SmartIQ, after the Create Email Activity action, add an Update Entity Action to change the "Email Trigger Send" to yes/true.

Action Output

Dynamics Create Email Activity Action has one output, Entity Id, which is the GUID of the newly created email activity.

Dynamics Execute Transaction Action

The Execute Transaction action is used in conjunction with the Transaction Mode input on the other Dynamics actions. When the other actions have that flag set, instead of sending to Dynamics directly their actions are instead cached in memory by JobGuid. The Execute Transaction action then sends the cached actions for processing by Dynamics.