I am using the lightning datatable in order to display the CaseShare data for a Case record within a lightning component. The feature works great however as the field UserOrGroupId on the CaseShare object is not editable I can only ever get the table to return the Id value of the user or group with which the record is shared. Below I am trying to override the value with a text value. But I am stopped as the UserOrGroupId is not editable. I have also tried to create a map of the data but was unable to get the correct data to display on my datatable.
@AuraEnabled
public static List<sObject> getCaseShareData(Id caseId){
List<sObject> caseShareList = [Select Id, CaseId, RowCause, UserOrGroupId from CaseShare where CaseId = :caseId];
for(sObject myCaseShare : caseShareList){
myCaseShare.put(CaseShare.UserOrGroupId, 'Test Name');
}
return caseShareList;
}