I have below piece of code where I want to traverse to details from the base query on master object. But I am getting error Like :
Error
Compile Error: Didn't understand relationship 'Account_List_Item_vod__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
Apex code
Map<Id,set<Id>> MapOfAcctListItem = new Map<Id,Set<Id>>();
for(Account_List_vod__c cpc : [select Access_vod__c,Display_Order_vod__c,Icon_Name_vod__c,Id,Name,OwnerId,
(select ID,Account_vod__c,External_ID_vod__c
from Account_List_Item_vod__r)
from Account_List_vod__c
where OwnerId in :MapOfTierObj.keyset()
And Name =:ListName])
{
if(!cpc.Account_List_Item_vod__r.isempty())
{
if(!MapOfAcctListItem.containsKey(cpc.OwnerId)){
MapOfAcctListItem.put(cpc.OwnerId,cpc.Account_List_Item_vod__r);}
else{
MapOfAcctListItem.get(cpc.OwnerId).addAll(cpc.Account_List_Item_vod__r);}
}
}
Can someone please let me know where I go wrong here?
Child Relationship Name
. developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/…