Tip #566: Constants in the workflow

Some might say that this tip is trivial but I was surprised myself when a very seasoned and knowledgeable user asked me how to use constants in the workflow.

They wanted to push an estimated close date for all open opportunities one month forward to account for the festive season that has just ended (for most people, anyway) and at the same time to bump the estimated value by 5% to account for the inflation.

For dates, use of constants is very clear – just use operator Set to, set the duration using dropdowns and select before or after (i.e. subtract or add). For money and numeric fields it is less obvious: do not use any of the fields but simply supply a constant as a default value.
Enter constants in the workflow

The end result looks like this:
Workflow update using constants

Set the workflow to be called on demand and then select multiple records and run the workflow. If you have hundreds of records that wouldn’t fit on one or two pages, you may want to consider some automation, like MSCRMWorkflowRunner or Bulk Workflow Tool for XRM Toolbox.

3 thoughts on “Tip #566: Constants in the workflow

  1. Rob Boyers says:

    or the workflow executor http://www.gapconsulting.co.uk/our-solutions/free-tools/workflow-executor that can throttle your executions should you need to do mass updates in business hours

  2. Gunnar Bjarnason says:

    Hi Georg,
    How can I add fixed number of days (more than 29), say 70 days to a date field?

    • Gunnar,

      if you’re picky about number of days being exactly 70 and not, say, 2 months and 10 days, you’d have to resort to custom activities. There are plenty of free ones around that deal with functions like DateAdd, etc.

      Cheers

Leave a Reply

Your email address will not be published. Required fields are marked *