+ Start a Discussion
SimonGODSimonGOD 

Opportunity Validation Rule

Hi....I need a Validation rule that says once a certain custom Check Box field has been ticked, the Opportunity is no longer editable. Check Box will only be accessible by System Admin.  Reason is we will be driving certain other process from a finalised Opportunity and can't have any of the details changed once it is being used in the other processes....thanks

Best Answer chosen by Admin (Salesforce Developers) 
SteveMo__cSteveMo__c

Well if you're not too busy, maybe you can work some of your "40 Loaves 40 Fishes" magic and miracle me up some of these bad boys ;-)   

 

http://beeradvocate.com/beer/profile/863/7971

 

All Answers

SteveMo__cSteveMo__c

I'm assuming that this must be the 7th day and you're resting, otherwise you would have been able to figure it out for yourself ;-p

 

Anyway, here you go:

 

AND(CheckboxField__c = TRUE, 
PRIORVALUE(CheckboxField__c) = TRUE, 
$Profile.Name <> "System Administrator")

or you could just create a Read-Only Page Layout and Record Type  

 

SimonGODSimonGOD

Thanks Stevemo......I was busy walking across water so didn't have time to figure it out myself!:smileyhappy:

SteveMo__cSteveMo__c

Well if you're not too busy, maybe you can work some of your "40 Loaves 40 Fishes" magic and miracle me up some of these bad boys ;-)   

 

http://beeradvocate.com/beer/profile/863/7971

 

This was selected as the best answer
SimonGODSimonGOD

consider it done my child....when you hit the bars at the weekend, and your vision starts to go slightly blurred, remember I'm by your side all the way!

SteveMo__cSteveMo__c

...and it was good

 

Amen

rachel.benson@earley.comrachel.benson@earley.com

Would this rule work for a picklist option? Say if a particular stage is selected it will lock the opportunity from being changed unless done by a system administrator?

SteveMo__cSteveMo__c

Hi Rachel,

 

Can you give me an example of what you're trying to do?  I have a few VR's like that you can borrow and hack up.

rachel.benson@earley.comrachel.benson@earley.com

Hi Stevemo,

 

Thank you for responding. I am a SFDC admin but I haven't done any work with formulas. What we are trying to do is once one of our opportunities is considered closed-won which is our stage 6 we want the amount field to lock so that only two specific users can change the field if necessary but all other users would get an error message.

 

I assume it is a validation rule and I was also under the impression that we wouldn't be able to specify a particular person but user profile such as admin etc.

 

I really have no idea how to begin to create the formula or the rule.

 

Any help would be greatly appreciated.

 

Rachel

 

SteveMo__cSteveMo__c

No problem Rachel, I think I have something that will work for you.  Which edition of SFDC are you using? 

SteveMo__cSteveMo__c

Hi Rachel,

 

You can specify a specific user in a VR, but that's usually not desireable due to the incresed Admin.PITA Ratio.  Stick with Roles and/or Profiles wherever and whenever possible (and learn to say "No" to people).