You need to sign in to do that
Don't have an account?
Jack Andrew
Table is not refreshing even after using the refreshApex
I am new to LWC and trying to fetch the records in the Lightning Datatable, which is working fine. After that i am trying to insert a record into the same using the record edit form and using refreshApex to display the inserted record immediately.
Can someone help me with the same?
PFA the code snippet for the same
Can someone help me with the same?
PFA the code snippet for the same
@wire (getAccData,{recordId: '$recordId'}) getAccTable({data, error}){ if(data){ this.tableData = data; } else{ console.log(error); } }
Here, i am storing the data returned from apex in tableData and then calling the same table data in refreshApex. But it's not working.
handleSave(){ insertAcc({name : this.name}) .then((result) => { this.result = result; return refreshApex(this.tableData); }) .catch((error) => { this.error = error; }); }
Hey Jack,
Instead of data, try using the whole result. Please refer to the below code.
Please mark it as the best answer, if it helps.
Thanks
All Answers
Hey Jack,
Instead of data, try using the whole result. Please refer to the below code.
Please mark it as the best answer, if it helps.
Thanks