• NavJyoti Pandey
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hello All,

I have a contact object and custom__c object. Where in Custom__c has a lookup relation to contact. My requirement is, for every contact record, have to loop through all the child records. For this I need a map<contact_Id, List<custom__c>>. 

I am trying different ways to do it with no luck. Any thoughts on this is appreciated.

Once I have a map, I am planning to do the following:
for (ID conid:  map.keyset())
{
      for(custom__c cust : map.get(conid))
      {
            if(cust.status==True)
            {
                   // update few fields on contact
            }
      }
}