1

I have 2 Managed package custom objects workcalnder(pse__Work_Calendar__c) and holiday(pse__HolidayObj__c) and their is lookup relationship between them. WorkCalnder is parent and holiday is child. the api name of the relation ship field is pse__Work_Calendar__c and the child relationship name is Holidays.

And i am trying to do parent to child soql query. Below is my query

Select id,Name,(select id, pse__Date__c FROM Holidays__r) from pse__Work_Calendar__c

while doing this getting below error.

Compile Error: (select id, pse__Date__c FROM pse__Work_Calendar__r) from pse__Work_Calendar__c ^ ERROR at Row:2:Column:110 Didn't understand relationship 'pse__Work_Calendar__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.

i don't understand what is mistake that i did?

Please help on this, thanks in advance.

1 Answer 1

1

Use package namespace for the child relationship. Modify the query to -

[SELECT Id, Name, (SELECT Id, pse__Date__c FROM pse__Holidays__r) FROM pse__Work_Calendar__c]

Also remember to follow query best practices like indentation and capitalization. They look a lot better that way.

1
  • Thanks Saket, it is working. Thanks for your suggestion. Nov 20, 2018 at 10:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .