I'm still very new to Salesforce/Apex development but I'm struggling to understand how I would pass the SelectedRows of a datatable through to Apex. I've managed to pass simple data types through on the click of a button but I'm not sure as to what the datatype of the list/array would need to be within Apex. Ideally I would still need to access not only the Id of the SelectedRow but also the data contained within the row. Any help would be greatly appreciated!!
LWC JS
handleConfirm(){
createNewRec({stringNameType: this.stringNameType, lstSelectedRecords})
.then(result =>{
this.result = result;
})
.catch(error =>{
this.error = error;
})
}
Apex
@AuraEnabled
public static String createNewRec(String stringNameType, List<???>lstSelectedRecords){
String returnResult = 'something';
system.debug('stringNameType: ' + stringNameType + ' lstSelectedRecords ' +lstSelectedRecords);
return returnResult;
}