+ Start a Discussion
MargiroMargiro 

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

PIAB USA

jkucerajkucera

Set:

 

IsClosed = True;

 

 

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

 

 

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

http://www.salesforce.com/us/developer/docs/api/index.htm