I have setup a validation rule to prevent any user with a particular profile(Worker)
not to edit the record except the status field. This record is of Case object
. I wish to allow the user to update only the case status to close when the recordType is "NmN Record Type"/'PHN Record Type'
, meaning when the record is owned by NMN group then do not allow the "Worker"
profile to edit it. Below is my validation rule:
AND
(
OR(
AND($Profile.Name ='Worker',TEXT(Status)!= 'Closed',ISCHANGED( Status)),
AND($Profile.Name ='Worker',NOT(ISCHANGED( Status )), NOT(ISNEW()))
),
OR(RecordType.Name = 'NmN Record Type' , RecordType.Name = 'PHN Record Type')
)
My problem - I have a process builder which fails due to this validation rule. The process builder tries to update the case's status to New when it is created for the first time. I want to prevent the user to not edit the record after it has been created for the first time. It seems this condition is becoming true when the process builder tries to update the record - AND($Profile.Name ='Worker',NOT(ISCHANGED( Status )), NOT(ISNEW())
. Does'nt the PB runs in system context though? How to allow Process builder to update the record without even though validation rule passes? Any insight is appreciated.
I also look at this article - https://help.salesforce.com/articleView?id=000247715&type=1