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
thecrmninjathecrmninja 

Validation to lock object if all but a few fields are edited

I have a conundrum I can't seem to sort out.  I would like to be able to lock a record type from certain users when all but a few fields are edited.  I have a semi-functional rule in place.  However, the issue is that if one of my Editable fields is changed, the validation allows any of the other fields to be changed.  I can't come at it the other way b/c this object has too many "protected" fields to compile a rule with that approach. 

 

Here is a generic version of what I have now....

 

 

AND( $RecordType.Name = "Record Type Name", NOT(OR( (ISCHANGED(Field1__c)), (ISCHANGED(Field2__C)), (ISCHANGED(Field3__c)), (ISCHANGED(Field4__c)) )))

 

I'm working with a few more fields and some more logic-layering, but the idea is generally captured above.  My question is, is there a way of ensuring that ONLY the "OK" fields are edited, not "OK" fields OR "Protected" fields when OK fields are edited at the same time? (traditional approaches like Read Only, etc. cannot be applied in this case due to permissions)

 

 

Best Answer chosen by Admin (Salesforce Developers) 
thecrmninjathecrmninja
The answer as I suspected (and support confirmed) was that this really cannot be accomplished via validations.  Using child objects or, more optimally, Apex Before Update Triggers is the key.