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
Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan 

Query result is not displaying all the fields in the query..any idea?

Hi All, 

I am facing one issue as mentioned below, 
  • Custom Object is queried with fields in it along with some parent fields and also sub query. But when I am returning the result in the debug log I could see only fields related to the custom object only returned in the results.
  • Due to this, if I add the same list in to any wrapper or passing it to a map it was showing only those values displayed when I try printing it in a VF page.
Appreciate your help!

Thanks, 
Kamatchi Devi Sargunanathan
Best Answer chosen by Kamatchi Devi Sargunanathan
Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan
I found the issue. Here while printing over the debug statement we could not see the whole list of query values. But when accessing it in controller like instancename.fieldname I could see the value. 

Example - List<child__c> chidList  = [SELECT id, name, parent__r.name FROM child__c];
system.debug('childList====='+chidList  );  ==> this will print only id, name of child__c.

But, if we try to get this related object value like accList[0].parent__r.name this will return the value

 

All Answers

Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan
I found the issue. Here while printing over the debug statement we could not see the whole list of query values. But when accessing it in controller like instancename.fieldname I could see the value. 

Example - List<child__c> chidList  = [SELECT id, name, parent__r.name FROM child__c];
system.debug('childList====='+chidList  );  ==> this will print only id, name of child__c.

But, if we try to get this related object value like accList[0].parent__r.name this will return the value

 
This was selected as the best answer
Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan
Same applies to subquery as well.