You need to sign in to do that
Don't have an account?
Eric Fraser
ISPICKVAL in conjunction with ISCHANGED
I am trying to make a validation rule to go along with my apporval process. I need to lock the stagename pick list for 3 of my stages below. The code I have kinda works. I just can not save any opportutiny that is within that stage.
My question is: how do I make the validation rule where as once the opportunity is in that stage (after apporval) the validation turns off for that stage so I can modify and save that opportunity.
AND(
$Profile.Name <> "System Administrator",
OR(
ISPICKVAL(StageName, "Pursue"),
ISPICKVAL(StageName, "Target"),
ISPICKVAL(StageName, "Bid")
))
My question is: how do I make the validation rule where as once the opportunity is in that stage (after apporval) the validation turns off for that stage so I can modify and save that opportunity.
AND(
$Profile.Name <> "System Administrator",
OR(
ISPICKVAL(StageName, "Pursue"),
ISPICKVAL(StageName, "Target"),
ISPICKVAL(StageName, "Bid")
))
ISPICKVAL(PRIORVALUE(Request_Status__c),"Error")
https://developer.salesforce.com/forums/?id=906F00000008pFfIAI
All Answers
Can you please let us know what will be the value of stagename field once the record is approved? I believe you are using field update on StageName field in approval process.
Thanks,
Pankaj
Yes I am using a field update in the approval process. All opportunities start in "Concept" then when it is approved it is updated to "Pursue" then to "Target" then to "Bid". I want the validation rule to keep my employees from changing(locking stage field) the stage on their own but just for these 3 specific stages. Let met know if you have any other questions.
I really apprecaite your help,
Eric
ISCHANGED(StageName ) && PRIORVALUE(StageName) = "Bid" && ISPICKVAL(StageName, "Target")
$Profile.Name <> "System Administrator",
ISCHANGED(StageName),
PRIORVALUE(StageName) == "Pursue",
ISPICKVAL(StageName, "Target")
)
I modified it to what I have and this would just be a snipit of moving from "Pursue" stage to "Target" Stage. But it is not working...
ISPICKVAL(PRIORVALUE(Request_Status__c),"Error")
https://developer.salesforce.com/forums/?id=906F00000008pFfIAI
AND(
$Profile.Name <> "System Administrator",
ISPICKVAL(PRIORVALUE(StageName),"Pursue"),
OR(
ISPICKVAL(StageName, "Target"),
ISPICKVAL(StageName, "Bid")
))
Thank you for your help, Ill make other validations for the different stages!
Concept stage Validation Rule:
AND(
$Profile.Name <> "System Administrator", //only system admins can modify all stages
ISPICKVAL(PRIORVALUE(StageName),"Concept"), //prior value in stagename was concept
OR(
ISPICKVAL(StageName, "Pursue"), //new value in stagename is pursue
ISPICKVAL(StageName, "Target"), //new value in stagename is target
ISPICKVAL(StageName, "Bid") //new value in stagename is bid
))
// If you want to lock all stages then dont use anything after the OR, there are stages that I want the emplyee to be able to change it to such as "No Bid", in our company we do not need approval to No bid.
Pursue stage Validation Rule:
AND(
$Profile.Name <> "System Administrator",
ISPICKVAL(PRIORVALUE(StageName),"Pursue"),
OR(
ISPICKVAL(StageName, "Target"),
ISPICKVAL(StageName, "Bid")
))
Target stage Validation Rule:
AND(
$Profile.Name <> "System Administrator",
ISPICKVAL(PRIORVALUE(StageName),"Target"),
ISPICKVAL(StageName, "Bid")
)
This was easly done with cloning the orginal Validation Rule
Thank you for your help and hopefully this can help some one else in the future!
Eric
mark the solution that helped to resolved so that it can help others.