function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ti Saunders 8Ti Saunders 8 

Workflow rule to trigger when field changing only from a certain value

Hello,

I am trying to create a formula for a workflow rule that will cause it to trigger only when a field changes from a certain value.

Specifically:

I want a field named "Lead_Status" (picklist) to be set to the value "Returning", when an account owner is changed FROM one of our internal admin accounts (i.e. user 1, user 2, or user 3.) to a sales rep (i.e. user 3, user 4, or user 5) AND another field named "ABW" is NOT checked (i.e. boolean = false).
Best Answer chosen by Ti Saunders 8
Piyush Gautam 6Piyush Gautam 6
Hi Saunders,

Please use below code in formula rule in the workflow. Replace adminUserID and SalesUserID with your real scenarios ID.
AND(
OR(PRIORVALUE(OwnerId)='adminUser1ID', PRIORVALUE(OwnerId)='adminUser2ID', PRIORVALUE(OwnerId)='adminUser3ID' ) 
,OR(OwnerId='salesUser1ID', OwnerId='salesUser2ID', OwnerId='salesUser3ID' ),
HasOptedOutOfEmail = False
)

I hope you will found this solution helpful. If satisfied please mark as solved.

Thanks

All Answers

Lokesh KumarLokesh Kumar
Use PriorValue function to check the previous value of the picklist field.
 
Piyush Gautam 6Piyush Gautam 6
Hi Saunders,

Please use below code in formula rule in the workflow. Replace adminUserID and SalesUserID with your real scenarios ID.
AND(
OR(PRIORVALUE(OwnerId)='adminUser1ID', PRIORVALUE(OwnerId)='adminUser2ID', PRIORVALUE(OwnerId)='adminUser3ID' ) 
,OR(OwnerId='salesUser1ID', OwnerId='salesUser2ID', OwnerId='salesUser3ID' ),
HasOptedOutOfEmail = False
)

I hope you will found this solution helpful. If satisfied please mark as solved.

Thanks
This was selected as the best answer