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

Pros & Cons of Lightning Component vs. 3rd party frameworks in Salesforce UI development

Video in

Nikita drops by to share his invaluable experience of using popular 3rd party frameworks in Salesforce. http://media.blubrry.com/salesforceway/audio.xmcdn.com/group42/M05/25/57/wKgJ81rXk6XjaZIAAU_I_KtprFM998.m4a