function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Mass Update Task From a Lead

I am looking to close a certain task that is on a bunch of leads. All the leads have a common field, D1 owner. I have selected all of the leads I need using SOQL,

Lead[] lds = [Select name, D1_Owner__c from Lead where D1_Owner__c='0017000000NnIX7'];

How can I change the status field to "completed" for the task on all of these leads?


Matt Argiro





IsClosed = True;



for (Lead l: lds){ l.IsClosed=true; } update lds;



Here's the API doc's which has a list of all fields: