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

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.

  • Thanks Saket, it is working. Thanks for your suggestion. – Ramesh Kopparapu Nov 20 '18 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.