1

I'm trying to create a validation rule formula in Salesforce, that uses two picklist fields which have the same values : p1, p2, p3.

One of the picklists is on the account object and the other one on the contact object.

If the selected value on the contact record is p1 and on the contact's account record is p2 then I would like to throw an error.

Any help would be greatly appreciated.

5
  • I am Trying for a validation rule Account.selectlist__c <> selectlist__c . But i am getting an error "Error: Field selectlist__c is a picklist field. Picklist fields are only supported in certain functions." Commented Mar 20, 2014 at 6:20
  • 1
    this also refer to the same question is it?
    – highfive
    Commented Mar 20, 2014 at 6:56
  • are these multi-select picklists?
    – highfive
    Commented Mar 20, 2014 at 7:10
  • With a validation rule, you can only check this when the Contact is saved, not the Account. Commented Oct 30, 2014 at 2:03
  • To clarify, where is the validation rule? If it's on the Contact, then are you basically saying "Set the Contact picklist value to the value on the Account"? If so, then this would be better suited as a formula or field update since it would improve data collection.
    – HomerJ
    Commented Feb 17, 2015 at 16:24

3 Answers 3

1

You can use the functions: ISPICKLIST and TEXT

ISPICKLIST

Determines if the value of a picklist field is equal to a text literal you specify.

Text

Converts a percent, number, date, date/time, or currency type field into text anywhere formulas are used. Also, converts picklist values to text in approval rules, approval step rules, workflow rules, escalation rules, assignment rules, auto-response rules, validation rules, formula fields, field updates, and custom buttons and links.

Docu

Validation rule

ISPICKVAL(Account.selectlist__c, Text(selectlist__c))
-1

You should be able to create a validation rule on the account object with error condition formula like below if test_c is the common picklist field. test_c <> Owner.Contact.test__c

-1

If those are not multi-select picklist fields, try below formular

TEXT( Owner.Contact.Contact_PickList__c ) <> TEXT( Account_PickList__c )

I'm assuming that you are adding this validation rule on the Account object.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .