[SalesForce] Is that possible to write a validation rule that would allow to update only two fields of 800 on a custom object record

My colleague asked me today an interesting question I never thought of before.
Is that possible to write a validation rule that would allow to update only two fields of 800 on a custom object?

I know that this question might sound strange, as I would never try to do something like this myself, I would use page layout to restrict users from editing fields or FLS or in the worst case I would write an apex trigger to implement this. But this question is about configuration approach.

Also the reason why he doesn't want to use page layout is that he doesn't want to use record types and due to his requirements he had to make 798 fields of 800 readonly if value of some custom status field on record is On Hold.

I was thinking of using "ISCHANGED" advanced formula function but that would not distinguish if only two permitted fields were changed or more.

Best Answer

No. You can't have enough validation rules that could cover this, nor could you have one (or even a few) rules that would compile within the limits of the system. Something this complicated would be best served by a trigger that could check all 798 fields for changes.