Let's say I have some SObject (myCode__c) with three string values (e.g. key1__c, key2__c, and code__c). The combination of key1__c and key2__c should be unique.

Let's say I have a second SObject (myObject__c) which includes two picklists (e.g. category1__c and category2__c).

Values for myObject__r.category1__c correspond to myCode__r.key1__c and values for myObject__r.category2__c correspond with myCode__r.key2__c.

Is it possible to have a formula field on myObject__c which gives a value for myCode__r.code__c, as determined in accord with each objects other two fields?

(If so, how?)

1 Answer 1


The functionality you are looking for is called "VLOOKUP" but is only available in validation rules.

If you want to learn more about VLOOPUPs: https://success.salesforce.com/answers?id=90630000000gyFzAAI

  • Cheers for the response. I don't suppose you'd be able to elaborate why it is only available for validation (not that understanding such would help anyway). :-/ May 23, 2014 at 13:28
  • @BrianKessler Because salesforce doesn't allow it. You'll ultimately need a trigger to accomplish your goals.
    – sfdcfox
    Jun 21, 2014 at 13:51

You must log in to answer this question.

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