Find your content:

Search form

You are here

Validation using two Picklist Fields in 2 objects

 
Share

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.


Attribution to: PavanFoxPro

Possible Suggestion/Solution #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


Attribution to: varun guruvugari

Possible Suggestion/Solution #2

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.


Attribution to: highfive

Possible Suggestion/Solution #3

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))

Attribution to: Christian Deckert
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/30524

My Block Status

My Block Content