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
IT Admin 179IT Admin 179 

soql -> [object object] how to retrieve

when i  do this query
SELECT  campaign.name, FirstNaUser-added imageme,   LastName, HasResponded , contact.owner.name FROM CampaignMember 

//
the result  on  contact.owner.name    's value   shows     [object object]   , how to retrieve the information of  [object object]  ?

 
Sandeep WaliaSandeep Walia
Hi,

This code will work fine and give you the desired result if you are planning to use it in Apex. Although if you want to view what is in the [object,object] result you can either use Workbench (http://workbench.developerforce.com) or you can also use a Force.com explorer (https://developer.salesforce.com/page/ForceExplorer) which will definitely provide you the desired result.

Hope this helps
Sandeep
Maharajan CMaharajan C
Hi Admin:

We have an still an issue on this in Query editor so we have to go with workbench its also very simple:

But we can get the Owner Id in the Query Editor at Developer Console Using below:
SELECT campaign.name,FirstName,LastName,HasResponded,Contact.ownerId from CampaignMember

The people also faced the same issue here:https://salesforce.stackexchange.com/questions/17916/child-to-parent-query-object-object-is-the-result
the solution in the link also not get the name because i tried if you want please try.

But we can simply get owner name with help of Workbench so please follow the below steps:
1) GO TO -> https://workbench.developerforce.com/login.php

User-added image

2) change the query settings to get the parent details:
User-added image

User-added image

3)Use this Query in the box: SELECT FirstName,LastName,HasResponded,Contact.owner.Name,campaign.name from CampaignMember
User-added image

Can you please Let me know if it works or not!!!

If it helps don't forget to mark this as a best answer!!!

Thanks,
​Raj