Ask Search:
Eric FetterolfEric Fetterolf 

Workflow Rule with PRIORVALUE and Time-Dependent Actions

I'm attempting to trigger a set of actions (including time-dependent ones) when either a new account comes in with a status of "Active", or when an existing account's status changes from "Pending" to "Active".

The problem that I'm running into is that functions like ISNEW and PRIORVALUE are conflicting with the fact that the rule has time-dependent actions.

If my Evaluation Criteria is "created, and every time it's edited", I get an error about having time triggers associated with the rule.

If my Evaluation Criteria is "created, and any time it's edited to subsequently meet criteria", I get an error about functions like ISNEW and PRIORVALUE not being usable in this type of formula.

The formula I'm trying to use is:
AND(
  TEXT(ProducerLocationStatus__c) = "Active",
  OR(
    ISNEW(),
    TEXT(PRIORVALUE(ProducerLocationStatus__c)) = "Pending"
  )
)

So I'm not sure how to reconcile these requirements. Is there workaround or another approach I could take to accomplish this?
Best Answer chosen by Eric Fetterolf
Douglas BurkhartDouglas Burkhart
Hi Eric,

Both of the issues you are encountering are limitations for workflows. However, you could do this by first creating a custom checkbox field and setting up two workflows.

Workflow 1:
Evaluation Critieria: created, and every time it's edited
Rule Criteria: Use your formula
Immediate Action: Field update to check the box for the custom field AND make sure to check the box in the field update for "Re-evaluate Workflow Rules after Field Change"

Workflow 2:
Evaluation Criteria: created, and any time it's edited to meet criteria
Rule Criteria: Checkbox equals True
Time Based Action: Schedule your action as intended AND at that same time run an additional field update to uncheck your checkbox field so that if the process needs to run again on the same record, the checkbox field can be checked.

Doug

All Answers

Douglas BurkhartDouglas Burkhart
Hi Eric,

Both of the issues you are encountering are limitations for workflows. However, you could do this by first creating a custom checkbox field and setting up two workflows.

Workflow 1:
Evaluation Critieria: created, and every time it's edited
Rule Criteria: Use your formula
Immediate Action: Field update to check the box for the custom field AND make sure to check the box in the field update for "Re-evaluate Workflow Rules after Field Change"

Workflow 2:
Evaluation Criteria: created, and any time it's edited to meet criteria
Rule Criteria: Checkbox equals True
Time Based Action: Schedule your action as intended AND at that same time run an additional field update to uncheck your checkbox field so that if the process needs to run again on the same record, the checkbox field can be checked.

Doug
This was selected as the best answer
Eric FetterolfEric Fetterolf
Thank you Doug, this worked great!