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
PaulSFDCDevPaulSFDCDev 

validation rule - Compare 4 Fields

Hi, I'm new to validation rules. I'm wondering if there was a way to compare if any of the 4 fields have the same value. These 4 fields are user object fields. If not, would workflow be better for this?
Rakesh ARakesh A
Hi Paul,

Case 1: if you know all 4 fields u can use valdiation rule as F1 == F2 & F2==F3 & F3==F4.
Case 2: if you dont mention fields and you want check any 4 fields out off all fields in the object. Then you have to write a trigger before insert, before update. I suggest to use schema class to play with all fields with in your logic as part of comparision.

Thanks.