Skip to content

Dynamics CRM 2011 & 2013 Workflow Plugin

Overview

The Dynamics CRM 2011 Workflow Plugin extends Microsoft Dynamics CRM 2011 and 2013, enabling Dynamics CRM to send notifications to web services and Neuron topics using Dynamics CRM’s workflow functionality.

Features

The Dynamics CRM Workflow Plugin has the following features:

  • Send entities to topics and web services.
  • Send dynamic entities to topics and web services.
  • Send customized XML with data from related entities to topics and web services.
  • Execute fetch XML queries and send the results to topics and web services.
  • Run XSL transforms before sending data to web services.
  • Capture detailed tracing information.

Installing

See the section Installing the CRM Workflow Plug-in

Configuration

See the section Configure the CRM Workflow Plug-in

Verifying Installation

See the section Verifying the CRM Workflow Plug-in Installation

Workflow Steps

The following workflow steps will be available for use in CRM workflows:

Step NameDescription
Advanced Send (Topic)Allows a fetch XML query to be executed and sent to a Neuron topic.
Entity Send (Topic)Sends the workflow’s entity to a Neuron topic. Suitable for built-in CRM entities.
Field Send (Topic)Allows custom XML to be sent to a Neuron topic.
Dynamic Entity Send (Topic)Sends the workflow’s entity to a Neuron topic. Suitable for customized CRM entities.  Available in the CRM 4.0 plug-on only
Advanced Send (Service)Allows a fetch XML query to be executed and sent to a web service.
Entity Send (Service)Sends the workflow’s entity to a web service. Suitable for built-in CRM entities.
Field Send (Service)Allows custom XML to be sent to a web service.
Dynamic Entity Send (Service)Sends the workflow’s entity to a web service. Suitable for customized CRM entities.  Available in the CRM 4.0 plug-on only

Workflow Step Property Reference

Entity Send (Topic)

The Entity Send (Topic) step allows standard CRM entities to be sent to a Neuron topic. The message body will contain the serialized entity data. In order to send data from customized CRM entities, use the Dynamic Entity Send step.

PropertyDescription
Fail on ExceptionSets whether or not the workflow instance will fail when an exception occurs.
TopicThe name of a Neuron topic to receive events.
PublisherThe name of a Neuron party to use for publishing events.
Root NameThe name of the root element to create in the message.
Root NamespaceOptional. The namespace to use for the root element in the message.

Dynamic Entity Send (Topic)

The Dynamic Entity Send (Topic) step allows customized CRM entities to be sent to a Neuron topic. The message body will contain the serialized entity data.  The option is only available in the CRM 4 Plug-in.

PropertyDescription
TopicThe name of a Neuron topic to receive events.
PublisherThe name of a Neuron party to use for publishing events.

Field Send (Topic)

The Field Send (Topic) step allows custom XML to be sent over a topic. By using the dynamic values form assistant, a custom XML document can be designed to be used by notifications.

PropertyDescription
Fail on ExceptionSets whether or not the workflow instance will fail when an exception occurs.
TopicThe name of a Neuron topic to receive events.
PublisherThe name of a Neuron party to use for publishing events.
Root NameThe name of the root element to create in the message.
Root NamespaceOptional. The namespace to use for the root element in the message.
Field1 Name-Field20 NameThe name of an element to insert in the message.
Field1 Value-Field20 ValueThe value to insert into the message. Use the dynamic values form assistant (located on the right hand side of the property page) to bind the field to an entity property.

Advanced Send (Topic)

The Advanced Send (Topic) step allows a fetch XML query to be executed and sent over a topic.

PropertyDescription
Fail on ExceptionSets whether or not the workflow instance will fail when an exception occurs.
TopicThe name of a Neuron topic to receive events.
PublisherThe name of a Neuron party to use for publishing events.
Root NameThe name of the root element to create in the message.
Root NamespaceOptional. The namespace to use for the root element in the message.
FetchXmlTemplatePathThe path to a file on disk that contains the fetch xml query to execute. The results of the query will be the published message. The text [PrimaryEntityId] and [PrimaryEntityName] may be inserted into the template and will be replaced by the entity ID or Name.

Entity Send (Service)

The Entity Send (Service) step allows standard CRM entities to be sent to a web service. The message body will contain the serialized entity data. In order to send data from customized CRM entities, use the Dynamic Entity Send step. Advanced users may customize the transport used by the service shape by adding a WCF configuration elements to the CRM Async Service and referencing the configuration in the step properties.

PropertyDescription
ServiceUrlThe URL of a web service to receive messages.
ActionA SOAP action to use when communicating with the web service.
BindingNameOptional. The name of a WCF binding to use when communicating with the web service. If not specified the web service will be assumed to be a basic HTTP web service.
BindingConfigurationOptional. The name of a WCF binding configuration to use when communicating with the web service. The binding configuration must be located in the CRM Async Service configuration file.
EndpointBehaviorConfigurationOptional. The name of a WCF endpoint behavior configuration to use when communicating with the web service. The endpoint behavior configuration must be located in the CRM Async Service configuration file.
XsltPathOptional. The location of an XSLT document to use to transform the outgoing message before sending to the web service.
OneWayIndicates whether the service call is one-way or request/reply
Root NameThe name of the root element to create in the message.
Root NamespaceOptional. The namespace to use for the root element in the message.

Dynamic Entity Send (Service)

The Dynamic Entity Send (Service) step allows customized CRM entities to be sent to a web service. The message body will contain the serialized entity data. Advanced users may customize the transport used by the service shape by adding a WCF configuration elements to the CRM Async Service and referencing the configuration in the step properties.  The option is only available in the CRM 4 Plug-in.

PropertyDescription
ServiceUrlThe URL of a web service to receive messages.
ActionA SOAP action to use when communicating with the web service.
BindingNameOptional. The name of a WCF binding to use when communicating with the web service. If not specified the web service will be assumed to be a basic HTTP web service.
BindingConfigurationOptional. The name of a WCF binding configuration to use when communicating with the web service. The binding configuration must be located in the CRM Async Service configuration file.
EndpointBehaviorConfigurationOptional. The name of a WCF endpoint behavior configuration to use when communicating with the web service. The endpoint behavior configuration must be located in the CRM Async Service configuration file.
XsltPathOptional. The location of an XSLT document to use to transform the outgoing message before sending to the web service.

Field Send (Service)

The Field Send (Service) step allows custom XML to be sent over a topic. By using the dynamic values form assistant, a custom XML document can be designed to be used by notifications. Advanced users may customize the transport used by the service shape by adding a WCF configuration elements to the CRM Async Service and referencing the configuration in the step properties.

PropertyDescription
ServiceUrlThe URL of a web service to receive messages.
ActionA SOAP action to use when communicating with the web service.
BindingNameOptional. The name of a WCF binding to use when communicating with the web service. If not specified the web service will be assumed to be a basic HTTP web service.
BindingConfigurationOptional. The name of a WCF binding configuration to use when communicating with the web service. The binding configuration must be located in the CRM Async Service configuration file.
EndpointBehaviorConfigurationOptional. The name of a WCF endpoint behavior configuration to use when communicating with the web service. The endpoint behavior configuration must be located in the CRM Async Service configuration file.
XsltPathOptional. The location of an XSLT document to use to transform the outgoing message before sending to the web service.
OneWayIndicates whether the service call is one-way or request/reply
Root NameThe name of the root element to create in the message.
Root NamespaceOptional. The namespace to use for the root element in the message.
Field1 Name-Field20 NameThe name of an element to insert in the message.
Field1 Value-Field20 ValueThe value to insert into the message. Use the dynamic values form assistant (located on the right hand side of the property page) to bind the field to an entity property.

Advanced Send (Service)

The Advanced Send (Service) step allows a fetch XML query to be executed and sent over a topic. Advanced users may customize the transport used by the service shape by adding a WCF configuration elements to the CRM Async Service and referencing the configuration in the step properties.

PropertyDescription
ServiceUrlThe URL of a web service to receive messages.
ActionA SOAP action to use when communicating with the web service.
FetchXmlTemplatePathThe path to a file on disk that contains the fetch xml query to execute. The results of the query will be the published message. The text [PrimaryEntityId] and [PrimaryEntityName] may be inserted into the template and will be replaced by the entity ID or Name.
BindingNameOptional. The name of a WCF binding to use when communicating with the web service. If not specified the web service will be assumed to be a basic HTTP web service.
BindingConfigurationOptional. The name of a WCF binding configuration to use when communicating with the web service. The binding configuration must be located in the CRM Async Service configuration file.
EndpointBehaviorConfigurationOptional. The name of a WCF endpoint behavior configuration to use when communicating with the web service. The endpoint behavior configuration must be located in the CRM Async Service configuration file.
XsltPathOptional. The location of an XSLT document to use to transform the outgoing message before sending to the web service.
OneWayIndicates whether the service call is one-way or request/reply
Root NameThe name of the root element to create in the message.
Root NamespaceOptional. The namespace to use for the root element in the message.

Troubleshooting

If the installation cannot be verified, or entity data appears to not be published by Neuron, or the workflow instances are in an error state, use the following techniques to help troubleshoot the problem.

Enable Diagnostics and Tracing

The adapter configuration tool placed in the start menu by the installer allows additional tracing options to be configured. Selecting “Log errors” or “Log debugging information” will trace additional information to the application event log. Selecting “Log outbound messages” or “Log failed messages” will write outbound messages to the designated message log folder.

Figure_17.png

Enable MSCRM error pages

In the Web.config file for Dynamics CRM

<appSettings>

  <!--
        Show Developer Errors
        ========================================================================================
        If a server-side error occurs, this setting determines whether or not Debug error  messages are rendered to the user.  Debug error message are not recommended for  production environments, but may be useful in attempting to debug a problem you are having with MSCRM.
        Recommended Setting: "Off"
        Values: "On" or "Off"
  -->
  <add key="DevErrors" value="Off"/>

</appSettings>

Enable Dynamics CRM process logging

You can enable logging for the Dynamics CRM process that runs the workflow instances by creating a configuration file (or modifying the existing one). The default location of the CRM Async Service configuration file is C:\Program Files\Microsoft Dynamics CRM\Server\bin\CrmAsyncService.exe.config.

You must restart the Microsoft Dynamics CRM Asynchronous Processing Service after you create/change the configuration file.

<configuration>
  <system.diagnostics>
    <switches>
      <add name="System.Workflow LogToTraceListeners" value="1" />
      <add name="System.Workflow.Runtime" value="Verbose" />
      <add name="System.Workflow.Runtime.Hosting" value="Verbose" />
      <add name="System.Workflow.Runtime.Tracking" value="Verbose" />
      <add name="System.Workflow.Activities" value="Verbose" />
      <add name="System.Workflow.Activities.Rules" value="Verbose" />
    </switches>
    <trace autoflush="true" indentsize="4">
      <listeners>
        <add name="customListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\\logs\\Winwftrace.log" />
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>
Was this article helpful?
Dislike 0
Previous: Verifying the CRM Workflow Plug-in Installation