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
ptepperptepper 

Querying master-detail / related list with SOQL

Hello,

 

I have a custom object I use for data about events at my organization MyEvent__c, and a connector object  for tracking RSVPs to the events, RSVP__c.

 

I'm trying to query the RSVPs but can't seem to get a query to work. The RSVP__c object connects to the event object with a Master-Detail(Event) field. 

 

I'm trying to test queries with the Apex Explorer and I can't get the most basic SOQL queries to work:

 

Select Id from RSVP__c

 

Returns Error: Query failed: INVALID_TYPE: sObject 'RSVP__c' is not supported.

 

 

Select e.Id,e.Event_Title__c, (Select Id,Name from RSVP__r)  from MyEvent__c e where e.Id = 'a0A7xxxxxxxxxxx'

 

(with a valid id in there) returns error: 

 

Query failed:  INVALID_TYPE  ... (query)

ERROR at Row:1:Column:52

Didn't understand relationship  'RSVP__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. 

 

The WSDL has the relationship in there in the MyEvent__c object:

 

   <element name="RSVP__r" nillable="true" minOccurs="0" type="tns:QueryResult"/>

 

I have no idea why this is not working. My guess is that it's a permissions thing or a namespace thing, but I don't know. 

 

Any help would be greatly appreciated. 

 

Thanks,

-paul

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell
Apex Explorer by default now uses a fairly old API version, you'll need to bump it up to something more recent like 16.0 (in the settings).

All Answers

SuperfellSuperfell
Apex Explorer by default now uses a fairly old API version, you'll need to bump it up to something more recent like 16.0 (in the settings).
This was selected as the best answer
ptepperptepper

That was it.

 

Thanks for that and for such a fast reply, I don't think I would have ever thought to check that. 

 

-paul