Activity Forums Salesforce® Discussions How to insert all contact list using map?

  • Aman

    Member
    August 9, 2017 at 6:10 am

    Hello Shariq,

    you can try this  :

    List<contact> conList =new List<contact>();

    for(Id ide :mapAccIdVsCon.keySet())
    {
    for(Contact c : mapAccIdVsCon.get(ide))
    {
    conList.add(c);
    }
    }
    insert conList;

  • Parul

    Member
    September 16, 2018 at 1:37 pm

    hi

    you can try this code:

    List<Position__c> newsumrecords = new List<Position__c>();

    for (Contact con : fullcontacts)

    {
    map<Date, set<Decimal>> mrns = conid2datemapmap.get(con.Id);

    for (Date d : mrns.keyset())
    {

    Position__c refent = new Position__c(
    Referring_Physician_del__c = con.Id, FSC__c = 'None', Service_Date__c = d, Count_of_MRN__c = mrns.get(d).size());

    newsumrecords.add(refent);
    debuglog += '<br/>' + (newsumrecords);

    }
    }

     

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos