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
leanne2leanne2 

mass update tasks

Hello,

 

I want to be able to select mutiple tasks from the list view and update "Related To" field. I do not want to use app exchange because it doesn't support "Related to" object.

 

I've done the Opportunity based on the tutorial below but I can't do it for the Task.

 

Any ideas to make it work for Task?

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_massupdate.htm

 

Thanks!

Leanne

Nickname_BravoNickname_Bravo
The related to field is the "WhatId" so if you were to query : 

select id from task where WHATID='**account Id**'

it will return all the tasks related to the account ID, it works with all other id's that tasks can be related to as well. 

Create a visualforce page that can output a table with all the tasks you want related to an account/opportunity/campaign... etc. Then create a function that will save the updated tasks. 

Further more, you can query a batch of recent account related tasks.

Select id, createddate from task where what.type = 'Account' and createddate = this_month ORDER BY Createddate DESC LIMIT 100
that will return the IDs of the most recently created tasks.

You can really play with that and create a page that will allow you to "mass update" tasks. 

Hope that helps.