I have a Case object related to a Custom Object work part (Api Name- Work_Part__c ). Case is the parent object. I am trying to fetch all the work parts related to a case using below query
List<Case> c = new List<Case> (); c =[Select Id from Case where Id ='5006F00001tjI5S']; system.debug('size' + c.size()); system.debug('Workparts' + c.work_parts__r.size());
In the debug log, size is 1 , but the Workparts value is 0. Though the case with Id '5006F00001tjI5S' has 2 work parts as the related list. I triple checked relationship name is work_parts__r . Not sure, what I am missing.