+ Start a Discussion
Swathi VenkatesanSwathi Venkatesan 

data model and relationships

Based on only the code below, what do we know about the data model?
interviewer__r.position__r.status__c = 'Open';
a. Position__r is a custom object.                       
b. Position__c is a custom field on the interviewer__c object
c. Status__c is a picklist field.                       
d. Interviewer__c is a custom object

Please let me know which is the right answer with explanation
Shivdeep KumarShivdeep Kumar
Hi Swathi,

This query shows the parent and grandparent with field relationship. If you break it then you will find like this.
" Parent__r.grandParent__r.field " . It happens only for custom object, if they will be standard object so relationship will be like
" Parent.GrandParent.Field " . 
Interviewer__c is a custom object, which is a lookup to quering object.
Eg:- Select Id, interviewer__r.position__r.status__c  from XYZ , so XYZ object has a interviewer__c field which is a lookup field .

Status__c is a picklist field, you can not say this because picklist data type is string and text data type is also string. So I am not sure about it and status field is on the position__c object. 
Position__c is a custom field on interviewer which is a parent of interviewer__c Object means field data type is lookup or master.