Ryan McKnight
Ryan McKnight

Reputation: 11

Salesforce Validation Rule - Allow certain user & profile to modify record after it's been approved

I've looked for answers and even looked at a lot of our other validation rules but can't quite seem to finish this off. I feel like I'm almost there but I can't get my syntax correct.

I'm trying to write a Validation Rule that would allow a certain user and profile to modify a certain record once it's been approved. This is the latest iteration of what I have written (with Record name, userID, and profileID masked):

AND(

 RecordType.Name = "Example Record",

 ISPICKVAL(Approval_Status__c , "Approved"),

 NOT($User.Id = "xxxxxxxxxxxxxxxx1") ||

 NOT($User.ProfileId = "xxxxxxxxxxxxxxxx2"),

OR(

 ISCHANGED(Status), 

 ISCHANGED(Requestor__c),

 ISCHANGED(Department_Owner__c),

 ISCHANGED(Support_Category__c),

 ISCHANGED(Permitting_Approval_Type__c),

 ISCHANGED(State__c), 

 ISCHANGED(County__c),

 ISCHANGED(Sites__c),

 ISCHANGED(Priority__c),

 ISCHANGED(Need_by_Date__c), 

 ISCHANGED(Days_til_Due__c), 

)

)

I usually can find an question/answer on this site that will point me in the direction I need to go but this time I haven't had such luck.

Any help is greatly appreciated.

Ryan

Upvotes: 1

Views: 3864

Answers (1)

Matt Kaufman
Matt Kaufman

Reputation: 808

I think you were close

AND(
RecordType.Name = "Example Record",
ISPICKVAL(Approval_Status__c , "Approved"),
NOT($User.Id = "xxxxxxxxxxxxxxxx1"),
NOT($User.ProfileId = "xxxxxxxxxxxxxxxx2"),
OR(
ISCHANGED(Status),
ISCHANGED(Requestor__c),
ISCHANGED(Department_Owner__c),
ISCHANGED(Support_Category__c),
ISCHANGED(Permitting_Approval_Type__c),
ISCHANGED(State__c), 
ISCHANGED(County__c),
ISCHANGED(Sites__c),
ISCHANGED(Priority__c),
ISCHANGED(Need_by_Date__c), 
ISCHANGED(Days_til_Due__c), 
)
)

Upvotes: 0

Related Questions