Use Routines and Groovy Scripts to Set Forecast Category Values

You can use routines or Groovy scripts to set the Best Case and Committed forecast categories. For example, your sales administrators can allow salespeople update the forecast category based on win probability, sales stage, or any criteria on the Opportunity details page or on the Edit Products (revenue lines) page. They can also use Groovy scripts on an ongoing basis to set the opportunity forecast category to Best Case or Committed.

Routines

Routines can be used on an ongoing basis to set the opportunity forecast category to Best Case or Committed. You can use separate routines to update the forecast category based on win probability or other business criteria. For example:
  • Routine 1: Update forecast category to BEST CASE for opportunities with a Win Probability >= 40% and <60%
  • Routine 2: Update forecast category to COMMITED for opportunities with a Win Probability >= 60% and <100%

You can also use a single routine to call a smart action or object function to run if/then/else logic similar to Groovy script logic.

Note: Routines are scheduled to run regularly so the opportunity forecast category update might not be immediately reflected in the sales forecast. If so, you might want to configure the routine to be triggered based on the Field Updated action type, which will run the routine each time the opportunity win probability is updated. This can be an important consideration in the final days of a forecasting period.

Groovy Scripts

You can also use Groovy scripts to set the opportunity forecast category to best case or commit. For example, when the Opportunity win probability is updated, a Groovy script can populate the FORECAST CATGORY field value using a Field Trigger based on sample logic:
  • Win Probability >= 40 and <60 set forecast category to BESTCASE
  • Win Probability >= 60 and <100 set forecast category to COMMIT
Here a sample screenshot of a Groovy script:

Sample screenshot of Groovy script logic for setting sales forecast categories to best case and commit

By default, new opportunities are created with a forecast category = PIPELINE, and when an opportunity is closed as Won the forecast category = WON, or if the opportunity is closed as Lost, the forecast category = OMIT