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
marcusaureliusmarcusaurelius 

Looking for code sample to perform a mass action

for creating activities for many records off a list view.  I see many examples of mass updates directly to records, but none for adding/updating activities..

 

tx if anyone knows anything!

*werewolf**werewolf*

Well the samples that you've seen (like this one) all apply really, it's just that when you loop through the selected records, you have to create a Task object, set its WhoId (for Contacts or Leads) or WhatId (for anything else) field equal to the ID of the current record and any other fields you need, and add that Task object to an array.  Then after the loop, call create on your array.