0

For the custom (reference) fields the relationship name is the same as field name, the only difference is that relationship name ends with __r and field name with __c

Example :

  • field name : Account__c
  • relationship name : Account__r

What is the logic for the standard fields & relationships ?

1 Answer 1

1

It's different for Accounts, since they have a hierarchy:

  1. ParentId will give you the Id
  2. Parent.Name Will return the parents name.

In general it would be

SELECT AccountId, Account.Name FROM Contact

As documented here

2
  • So for standard fields the field name looks like somethingId and the relationship name like something? example : OwnerId, Owner
    – benahm
    Oct 25, 2017 at 6:50
  • @benahm Yes, you are right!
    – itsmebasti
    Oct 25, 2017 at 6:52

You must log in to answer this question.

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