Workflow is one of the key features that differentiates Microsoft CRM from other solutions. Microsoft regards workflow as so important that they have a complete framework that is built into the operating system. This means that workflow can be integrated with almost any application running on windows.
The Windows Workflow Foundation allows programmers to create programs that stop and start and wait for something to happen just as a business process might do. For example, checking the credit status of an applicant for a mortgage may require many sequential or simultaneous tasks to be performed. The Windows Workflow Foundation allows for such complex processes to be modelled in software.
Microsoft CRM 4.0 uses the workflow engine but allows you to create your own workflow using the CRM application. Workflows operate automatically when certain things change on a record and they can be specified in the Settings-Workflow work area of CRM.
Workflow can be extended by a programmer using the Windows Workflow Foundation tools for Visual Studio 2005.

Each workflow is given a name and an entity that it applies to and can apply to just to the current user, their department, their business unit, or the whole organisation. This allows you to create workflow for just the sales department for example. In addition a workflow can be saved as a template to form the basis of other workflows.
Workflows are triggered by an event happening within CRM usually by a User creating or altering data. The available triggers are:
· Create. The trigger fires automatically when a record is created (as the new record is saved).
· Status Change. The status values against an entity are easily customised and should reflect the stage in the life history of the entity. A change in the status is a good place to create workflow actions which will vary according to each stage in the business process.
· Assign. Change of ownership (perhaps from a Queue to a User) can automatically fire a trigger.
· Attribute Change. Changes to particular field values in the database can automatically fire a trigger to start a business process. This could trigger a workflow when a custom checkbox is ticked for example.
· Delete. Automatic trigger to perform a process when an entity occurrence is deleted
Workflows can also be triggered on demand and are made available against the Activate Workflow button that appears when viewing a form. Finally, a reusable Child Workflow can be specified which can be called from other workflows.
The lower half of the workflow pane contains the workflow process which is specified as a series of steps. You can combine several steps into stages if you have a complex set of activities to be performed together within a single workflow. Each step performs an action which may send an email, create an activity, or change some data within the entity or related entity occurrences. More complex actions can, of course, be implemented by programmers.
The available action types are:
· Create Record. Create a new record usually specifying a related entity and defining data from the current record to give meaning to the new data. Activities and Notes can be created and related to the base record as well as any other entity.
· Update Record. Update the current or related entity data.
· Assign Record. Change the ownership of the current or related entity records.
· Send Email. Send an email or email template.
· Start Child Workflow.
· Change Status. Changing the status of the current record is especially useful if you make the status field read-only so it can only be changed automatically by workflow once all the relevant data has been specified and checked.
· Stop Workflow. Workflow is designed to pause and restart as the various processes are completed. This action indicates that the business process is complete.
The following screenshot shows the creation of a task activity during workflow triggered on the account entity. The create record action is used and the appropriate template form for the entity to be created appears. You may then enter the required values against the form which will be created automatically by the workflow process.
The Form Assistant on the right hand side which allows you to place Dynamic Values into the form. These values allow you to relate the newly created record to the current workflow entity occurrence.
You can see in the example that the regarding value is set to the account entity and the account name is referenced in the subject field value. This is done by positioning the cursor in the required field on the form template and then selecting the required field in the dynamic values, pressing the add button and specifying any default text (to be entered if there is no value in the required field). Pressing OK will insert the appropriate dynamic value into the form.
Note: You can add more than one dynamic field value into the list of fields and the first one with a value will be inserted or the default value if none of the fields have a value.
Two special dynamic entities are also made available in addition to the workflow and related entities:
· The workflow entity contains details on the workflow such as the current execution time.
· The create entity has information for the current transaction.
Workflow conditions allow for a single workflow to have a number of outcomes according to the state of the underlying data at the time the workflow is executed. The following example stops a workflow if a value has already been entered into the credit limit field of the account.

Conditions are very useful for the change status type of workflow to allow a single workflow to perform different steps according to the current value of the entity status.
Wait conditions can be specified on workflow so that the workflow pauses and waits for a change to occur on the entity data before proceeding (this is a feature of the Windows Workflow Framework).
Note: This may be preferable to the alternative of creating a second workflow rule on the attribute change event.
© redware research ltd 2007 |