You need to sign in to do that
Don't have an account?
nicks
custom button on list view which will update status to completed for selected(multiple) task.
I want to create a button which will allow me to update task as completed directly from the list view without opening individual task.
This button will directly update status without having to refresh entire page. This task list view will be on home page.
To create a button that allows you to update a task's status directly from a list view without opening individual tasks, you can use the Salesforce Lightning Web Component (LWC) framework. Here's an example of how you can implement this functionality:
Create a new Lightning Web Component:
Create a new Lightning Web Component using the Salesforce CLI or Developer Console. Let's name it "UpdateTaskButton".
HTML Markup (updateTaskButton.html): JavaScript Controller (updateTaskButton.js): Add the Component to the List View:
Go to the Lightning Page where the task list view is displayed (e.g., Home Page).
Edit the page layout and add the "UpdateTaskButton" component to the appropriate section of the page.
Set the taskId attribute of the component with the ID of the task you want to update.
With this setup, the button will trigger the handleUpdateTask() method when clicked. It uses the lightning/uiRecordApi module's updateRecord() function to update the task's status to "Completed". The result is displayed as a toast message using the lightning/platformShowToastEvent module.
If this helps , please mark this as Best Answer.
Thank you.