[SalesForce] Validation rule to allow only one field with value

I have 3 Text field in a page. While saving only one text field should have the value. If more then one text filed has a value it should throw an error. How i can do this in validation rule.

Best Answer

there could be other better ways, but one possible way i can think of is to do something like this

( IF(ISBLANK(Field1),0,1) + 
  IF(ISBLANK(Field2),0,1) + 
  IF(ISBLANK(Field3),0,1)
) > 1

this will check if more than one field has value, it will return true and you can show an error

Related Topic