youu can use below apex code, if you working with lightning please let me know i will write lightning component this code for check box
public class UpdateUsingCheckboxC {
@AuraEnabled
public static List <Contact> fetchContact() {
return [SELECT Id, FirstName, LastName, Phone FROM Contact Limit 10];
}
@AuraEnabled
public static void updateRecord(List <String> lstRecordId) {
List<Contact> lstUpdate = new List<Contact>();
for(Contact con : [SELECT Id, FirstName, LastName, Phone FROM Contact WHERE Id IN : lstRecordId]){
con.Phone = '999999'; // Add fields which you want to update
lstUpdate.add(con);
}
if(lstUpdate.size() > 0){
update lstUpdate;
}
}
}
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
youu can use below apex code, if you working with lightning please let me know i will write lightning component this code for check box
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
you can look at this documentation on how to use inline editing for bulk update using lightning datatable.
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.data_table_inline_edit
If this answers your question, please can you mark this as best answer. Thanks.