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
petec@i2isyspetec@i2isys 

IsPickval and PriorValue

I'm trying to create a workflow rule that looks at Account Status.  If the Account Status was Hold and then becomes any other value, I want it to fire off an email.  I used AND(ISPICKVAL(PRIORVALUE( Account_Status__c ),'Hold')) but it fires everytime a record with Status Hold is edited.
What am I doing wrong.
Best Answer chosen by petec@i2isys
venkat-Dvenkat-D
You should also check for  ISPICKVAL(PRIORVALUE( Account_Status__c ),'Hold') && ISPICKVAL(Account_Status__c,'XXX') to know the new value. Because just checking old value will fire everytime you edit irrespective of whether its changed or not

All Answers

venkat-Dvenkat-D
You should also check for  ISPICKVAL(PRIORVALUE( Account_Status__c ),'Hold') && ISPICKVAL(Account_Status__c,'XXX') to know the new value. Because just checking old value will fire everytime you edit irrespective of whether its changed or not
This was selected as the best answer
petec@i2isyspetec@i2isys
Hi, thank you for that.  I'm a little new to this.  Let's say I also have status' of Green and Red.  If I switch from Hold to Green or Red, I want it to fire. How would I write the formula?
ShivaKrishna(Freelancer)ShivaKrishna(Freelancer)
Hi ther 
Include Ischanged as well

ex:
AND( ISCHANGED(Book_of_Business__c ),
OR( ISPICKVAL(Book_of_Business__c , "Strategic Pipeline"),
ISPICKVAL(Book_of_Business__c , "")),
OR( ISPICKVAL(PRIORVALUE(Book_of_Business__c ), "Top 10"),
ISPICKVAL(PRIORVALUE(Book_of_Business__c ), "Customer & Top 10")))

let me know, if it helps you or need any help :)
shiva.sfdc.backup@gmail.com
venkat-Dvenkat-D
ISPICKVAL(PRIORVALUE( Account_Status__c ),"Hold") && 
(ISPICKVAL(Account_Status__c,"Green")  || ISPICKVAL(Account_Status__c,"Red"))
petec@i2isyspetec@i2isys
Venky, is && and || acceptable language or are those appreviations for something?
 
venkat-Dvenkat-D
&& - AND and || - OR . You can use either of them 
petec@i2isyspetec@i2isys
Ok, I put it in just like this and I don't get an error, but the email is not firing off.

AND(ISPICKVAL(PRIORVALUE( Account_Status__c ),"Turnkey") && 
(ISPICKVAL(Account_Status__c,"Green") || ISPICKVAL(Account_Status__c,"Red")))
 
petec@i2isyspetec@i2isys
Just to clarify, I set the status from none to Turnkey.  Then set the status to Green, and nothing happened.  Rule is for upon creation and everytime record is edited.
 
petec@i2isyspetec@i2isys
Nevermind, I did it in sandbox and it didn't fire but it does in production, thanks so much for your help!
 
venkat-Dvenkat-D
mark it as resolved to help others