i'm having big troubles to fill a map with the data of fields of related objects to the one that is declared as value.
Map<Id,GPMIR_obj_energyLead__c> mapToMap = new Map<Id,GPMIR_obj_energyLead__c>([SELECT Id, IdCommunity__c, Community__c, Community__r.name__c, Community__r.installation__r.CUPSInmueble__r.StreetSP__c, Community__r.partitionCoefficient__c FROM GPMIR_obj_energyLead__c WHERE Id IN : mapRelateLeadsWithCommunities.keySet() AND IdCommunity__c IN : mapRelateLeadsWithCommunities.values()]);
Here we have three objects:
Every one of them is the many in a many to one relationship with the next one in the list
When i debug the Map i'm only getting the fields of GPMIR_obj_energyLead__c (Id,IdCommunity__c,Community__c)
The query is right is SOQL, but there is something wrong in the development
Any idea of what am i doing wrong?