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
KiranRKiranR 

Custom list button to create a Task - how to assign it to multiple users


Since the standard New Task button was not working after migration to LEX, we created a custom list button called 'Create Task'  under Open Activities related list of Account Visualforce page.

The button works as expected -- opens a pop up window for task creation.

This custom button is allowing the user to create a new task but the 'Assigned To' field accepts only one assignee.

However, the user is able to create a task and assign it to multiple assignees from all the other records like Cases, Opportunities etc (All the Objects in our org have Standard Lightning Record pages except Account which is a Visualforce page)
https://releasenotes.docs.salesforce.com/en-us/summer18/release-notes/rn_sales_productivity_tasks_multiple_assignees.htm

Below is the code used for 'Create Task' button

if(typeof sforce !== 'undefined' && sforce !== null && '{!$User.UIThemeDisplayed}' === 'Theme4d'){ 

sforce.one.createRecord('Task'); 

} else { 

//window.open('{!URLFOR($Action.Task.NewTask, Account.Id )}'); 

}

Is there a way to include the 'Assigned To' mutiple assignees feature in the above code.

Thank you!