Friday, January 29, 2010

MSCRM: Edit data with Workflows

CRM workflows can be used for all types of situations and sometimes you might be surprised by what you can do with the Workflow tool.

For example, supposed you added a large group of Accounts and then realized that all the Territories are incorrect. You could edit them by hand, use a bulk edit technique or write some code.

All of the above methods, however, can be time-consuming and impractical. So what about a Worklow? You may have not considered workflows for editing data but often they can be the quickest way to change a large number of data records.

Create the workflow:
This is pretty basic workflow. Give the workflow a name and select the Account entity

Set the scope to Business Unit (or whatever is necessary for the edit). Clear all the check boxes except On Demand because the workflow will be executed manually.

Add a workflow step
In this case, we need to add an Update step to the workflow. We will be updating Territory based on a condition, so the workflow should be structured as shown below:

* Check Territory
If Territory(Territory):Territory equals [US East], then;
* Update Territory
Update: Territory [Set Properties]

In the Update statement, set the Territory to the correct entry (e.g. US West). After publishing the workflow, we can run it.

Executing the workflow:
Return to the Account View and select all of the records that need to be updated. When you click run workflow button, a dialog box will appear. You need to click OK to run it.

After waiting a short period of time for the workflow to run, check the Accounts and they should be updated.

This is meant to give you some ideas on using Workflows to edit all kinds of data (not just Accounts). It is a quick way to update large amounts of data and easy to do.

No comments: