function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
anup-prakashanup-prakash 

how can I access the parent object field through custom object

Hi,

 

         I have a look up on custom object student to a custom object class. I was trying to access the name of class through SOQL but it is returning the ID instead of the class name.. So how can I access the class name itself instead of the ID..

  

All Answers

neil12neil12

hi,

 

You have to use obj.id.fieldname

then it returns the name associated with the id.

anup-prakashanup-prakash
list<student__c> studentName = new list<student__c>();
studentName = [Select name, Class__r.Name From student__c ];
system.debug(studentName);


how will do it here?? Any help..
anup-prakashanup-prakash
Thanks..