Activity Forums Salesforce® Discussions How we can do bulk updates using MAP in Salesforce ?

  • Piyush

    Member
    September 13, 2019 at 3:34 am

    Hi Hariom,

    You can take help from this example:-

    Map<Id, String> m = new Map<Id, String>();

    Opportunity[] updates = new Opportunity[] {};

    for (Id id : m.keySet()) {

    updates.add(new Opportunity(Id = id, FieldName__c = m.get(id)));

    }
    update updates;

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos