I am trying to pass a Case SObject to apex class as parameter, but is not working. I did not see the System.debug
on the console. Why?
//wire the record
@wire(getRecord, { recordId: '$recordId', fields })
case;
setCaseStatus({
objCase: this.case // also tried this.case.data
})
.then(() => {
console.log('sucess! ');
})
.catch((error) => {
console.log('Error received: code' + error.errorCode + ', ' +
'message ' + error.body.message);
});
//Apex class method
@AuraEnabled(cacheable=true)
public static void setCaseStatus(Case objCase){
System.debug('CaseService.setCaseStatus.case: ' + objCase);
objCase.status = 'Working';
update objCase;
}
Another question: Is it possible apex void method in lwc?
uiRecordApi
andrecordUpdate
.