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
JakesterJakester 

Exception to validation rule that locks a closed opportunity

Hi All,

I have the following validation rule which locks down closed opportunities for everyone except my power users:

Code:
and(
or(
ISPICKVAL(PRIORVALUE(StageName),"Closed Won")
,ISPICKVAL(PRIORVALUE(StageName),"Closed Lost")
,ISPICKVAL(PRIORVALUE(StageName),"Closed Quote")
)
,and($Profile.Name <> "System Administrator" ,$Profile.Name <> "Power User*" )

)

It's working great, but I'd like to add an exception that says "If user is Sally Smith, then she can ONLY update the close date on Closed Won opportunities."

It's important that the exception is only for changing one particular field and is only extended to one particular user. Anybody know how to accomplish this? My only idea so far is to add on to the existing validation rule Sally's name, and then create another validation rule that says (in pseudo-code) (and(opportunity is closed, user is sally, not ischanged(field1), not ischanged(field2), etc.) and go on listing every single field on the opportunity except for the CloseDate. This is obviously a nightmare, because anytime we add or remove a field this huge formula would have to be updated.

I know there are some geniuses lurking out there - help me out! What am I missing?
Bethany EwingBethany Ewing
Is Sally the owner of the opportunity, or does she represent one user who should be able to update field x on any opportunity?


Message Edited by Bethany Ewing on 06-17-2008 11:30 AM
JakesterJakester
The latter: she's the one user that should be able to edit anything.
JakesterJakester
Ok, so I've resigned to writing the long validation rule like so:

Code:
and(
ISPICKVAL(StageName,"Closed Won")
,$User.Alias = "SallyS"
,or(
ischanged(CloseDate)
, ischanged( Field1 )
, ischanged( Field2 )
, ischanged( Etc. )
)
)

 
But I have a new problem: I can't add all of the fields to this list. Specifically, I can't add a multi-select picklist field to it. Is this a known issue? Is there any way I can prevent my user from messing with a multi-select picklist?