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
suji srinivasansuji srinivasan 

hi , can anyone suggest me how to make child to parent soql for the following object ?

User-added image
 
Task object have Master Detail Relationship with Phase , project objects
Project object  have Lookup relationship with program object .
API name for program lookup field in project object is inov8__Program__c
how to fetch program object values in this soql?

select name,inov8__Phase__r.inov8__Project__r.Name from inov8__PMT_Task__c 

Thanks in Advance.
mukesh guptamukesh gupta
Hi Suji,

Please use below co
select name,inov8__Phase__r.inov8__Project__r.inov8__Program__r.Name from inov8__PMT_Task__c

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh


 
suji srinivasansuji srinivasan
User-added image


hi mukesh,

In output I got [object object] . its not showing my phase,project,program.
mukesh guptamukesh gupta
Hi Suji,

Please use below code:
 
System.debug(JSON.serialize([
select name,inov8__Phase__r.inov8__Project__r.inov8__Program__r.Name from inov8__PMT_Task__c]));



if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh