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
DaveGCDaveGC 

Help with SOQL query for custom related object

Hello, I'm trying to figure out how to query a custom object that is related to opportunities. 

The object name is McaApp__Offer__c 
The lookup field for that object is McaApp__Opportunity__c (master-detail)

This is what I have, but I'mk missing something as this object is not related to accounts, what do I need to change?
 
SELECT id, Name, 
  ( 
    Select Id, Name From Opportunities ORDER BY Id DESC LIMIT 1 
  ), 
  ( 
    SELECT McaApp__Funder__c, McaApp__Status__c FROM McaApp__Offers__r WHERE McaApp__Opportunity__c = 'xxx' 
  )   
FROM Account 
WHERE id = 'xxx'

Thanks!