Post

3 followers Follow
0
Avatar

How to compare old and new values of a field in a Workflow rule?

I want to define a rule to alert when a field changes from a specific value.  For example, to alert when a project is changed from "Completed" to some other state.  But as far as I can see the rule logic can only access current values.  Am I missing something?  Is there another way I should do this?

thanks,

Richard

Richard Udy Answered

Please sign in to leave a comment.

4 comments

0
Avatar

Richard, 

Thank you for posting this in the Forum. Just for your information and best response in the future, please post these types of questions in the Customization section of the Forum. 

As for the question, this can most definitely be done using a Custom Workflow Rule. Configuration of it will be dependent on your needs but lets take your example for instance. The trick is for you not to be alerted on a regular basis or for the customization to run on State <> Completed every time. 

Normally, I would think a simple Validation Rule that Alerts you when $State <> 'Completed' would do the trick but this would trigger the Alert before a Project is completed (during the progress of the Project) which you do not want. What you can do is put other criteria in place like...

 

$State <> 'Completed' && $PercentCompleted = 100

This means that the Validation rule would only trigger if %Completed = 100 (normally only when the project is completed) AND the State has been changed from Completed to another state (i.e. Active, Draft, On Hold).

For further clarification, I suggest you register for one of our daily Q&A webinars (see the link-> http://www.clarizen.com/resources/online-demo.html#second ).These are great resources for free consulting with our Customer Success Managers and visual answers to your questions. 

Note - For Webinars best for Customization questions, please sign up for the Advanced Q&A Webinars.

 

Sincerely,

Boris Krutiy

Boris Krutiy 0 votes
Comment actions Permalink
1
Avatar

There is also a function for GetPreviousValue() that can be used to help with these rules.

Josh Santos 1 vote
Comment actions Permalink
0
Avatar

Some more information here would be helpful for what the question seems to ask where the response is more of a "workaround". Is there a way to access the previous and new values that are changing to validate against. I can see many uses for this, but for a current example I am wanting to add a workflow to set a baseline for a project when the projects state is changed from "draft" to "active". I tried using the GetPreviousValue function, but I keep getting errors when attempting to use it (maybe I am not using it right)

Jon Beckman 0 votes
Comment actions Permalink
0
Avatar

Please make sure that the run time is set to "Every time a record is created or edited" in order to use GetPreviousValue()

Josh Santos 0 votes
Comment actions Permalink