Intelligent Data Updates with Workflows

Processes are to workflows what quarterbacks are to football: they get all the glory. But just as hardcore football fan appreciates the toil of guards and tackles, so a CRM geek appreciates the useful little things workflows can help with. There’s a class of workflows I think of as “utility” workflows you can use to do things like: Need to learn about workflows in Dynamics CRM? Consider my one-day live online class, Building Workflows in Dynamics CRM, which also includes a copy of my book on the topic.
  • Make copies of – or “clone” — records, saving precious data entry time.
  • Set default values on new records.
  • Reassign child records based on attributes of the parent.

Another example is the topic of this article: performing intelligent data updates with workflows.

Bulk Edit vs. Intelligent Data Updates

Many record types have a “bulk edit” feature, where you can select multiple records and then select Edit from the More Actions menu. In the bulk edit form you’ll see, any change you make will be applied to all selected records. This can save you a lot of time compared to making changes one record at a time, and it always surprises me how few people know about the bulk edit feature. But here are at least two scenarios where it doesn’t work:

  1. Some record types don’t support bulk edit. Suppose you wanted to apply a change to all of your user records at the same time (for example, changing their e-mail access configuration from Outlook to E-Mail Router). You might select a bunch of user records, select the More Actions menu…and be disappointed to see that bulk edit isn’t supported for user records.
  2. Bulk edit can only apply the same change to all records, so it won’t help you if you want to apply some logic to changes (for example, suppose you want to update account records, changing the value of the Territory field based on the value of the state or zip code fields)

In scenarios like these you can use an on demand workflow. For example, suppose you want to update user records according to these two rules:

  • All users will be configured for the E-Mail Router.
  • The value of the Territory field will be assigned according to the current value of the Site field.

Here’s an on demand workflow that performs both of these. The first action is an Update that gets performed for all records; next, a conditional block checks the value of the Site field, and updates the Territory field with appropriate values.

To clear out a field, use the “Clear” operator.

On a related note, what if you want to make the same change to multiple records, but the change is to clear the value of a field? For example, suppose that after running the workflow in the previous example, you discover that you’ve caused a big uproar because it turns out the sales manager assigns users manually to territories and it’s not always neatly determined by the value of the Site field (darn it!) and you just want to clear it out. Once again, bulk edit can’t help you here, since all it can do is put a value into a field. Fortunately, Dynamics CRM workflows have a “Clear” operator you can use for this purpose. It’s in the Dynamic Values area of the workflow design environment in the Operator drop-down list. For text fields the two values are Set to (the default) and Clear. Here’s how you fix the problem you caused in the first example:

So…what did we learn?

  • If you want to make the same change to a group of records and can’t use bulk edit, you can get the same result with an on demand workflow.
  • On demand workflows have the added benefit that they can apply conditional logic when updating data.
  • Another thing workflows can do that you cannot do at all using the UI (e.g., bulk edit) is clear fields with the Clear operator.

1 Comment »

  1. Nishant Rana Said,

    July 15, 2010 @ 2:16 am

    Thanks for this very informative article :)

Leave a Comment