+ Start a Discussion
Guru 91Guru 91 

SQQL Query Help?


Hi everyone,
I have written a SQQL query. It is returning records but in some columns, it is showing  [Object Object] .  

Can anyone help me with this query


select Customer__r.Name,CDP_Asset__r.Deal__r.Name, CDP_Asset__r.Market__r.Name, CDP_Asset__r.Deal__r.Type__c,CDP_Asset__r.Deal__r.Stage__c from CDP_Asset_Customer_Account__c where Customer__r.Id IN ('0010B00001kPbx9QAC', '0010B00001nIOI0QAO', '0010B00001qTAG1QAO', '001U000000Ooi35IAB', '001U000000Ooj29IAB', '001U000000oSCeVIAW', '001U000001Tg4OAIAZ', '001U000001XqBrFIAV', '001U000001frl9cIAA')

Result:
User-added image







 
Khan AnasKhan Anas (Salesforce Developers) 
Hi Guru,

I trust you are doing very well.

Developer console query editor has a limitation, it cannot display grandparent information. You can run the code in the Execute Anonymous window and try to print out the list in Debug Logs or you can use Workbench (https://workbench.developerforce.com/login.php) which will definitely provide you the desired result.

Please refer to the below link with a similar discussion which might help you.

https://salesforce.stackexchange.com/questions/17916/child-to-parent-query-object-object-is-the-result

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in future.

Thanks and Regards,
Khan Anas
Guru 91Guru 91
Hi Khan Anas,
Thanks for your reply we can execute sqql in workbench or Anonymous window. beacuse Parent relationship queries are disabled in Workbench and workbench or Anonymous window.
Khan AnasKhan Anas (Salesforce Developers) 
Hi Guru,

If you want to enable the parent relationship queries on the workbench, try following steps.

- Click on the Workbench logo in the upper left-hand corner, select: "Settings".
- Under the Query & Search Options heading, select: "Allows SOQL Parent Relationship Queries".


Kindly mark this as solved if the information was helpful.

Thanks and regards,
Khan Anas
Guru 91Guru 91
Thanks Khan Anas  
Khan AnasKhan Anas (Salesforce Developers) 
Hi Guru,

It's my pleasure. I’m glad I was able to help!

Kindly mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.


Regards,
Khan Anas
Guru 91Guru 91
Hi Khan Anas,
Even though it is showing data in workbench, when i use this SQQL in apex class then it is returning [Object Object] Only.

Any suggestion