You need to sign in to do that
Don't have an account?
Team AppShark
Data updates are not reflected in UI after updating record from LWC using UpdateRecord function.
updateRecord(record)
// eslint-disable-next-line no-unused-vars
.then(() => {
this.dispatchEvent(
new ShowToastEvent({
title: 'Success',
message: 'Record Is Updated',
variant: 'Success',
}),
);
})
.catch(error => {
this.dispatchEvent(
new ShowToastEvent({
title: 'Error on data save',
message: error,
variant: 'error',
}),
);
});
// eslint-disable-next-line no-unused-vars
.then(() => {
this.dispatchEvent(
new ShowToastEvent({
title: 'Success',
message: 'Record Is Updated',
variant: 'Success',
}),
);
})
.catch(error => {
this.dispatchEvent(
new ShowToastEvent({
title: 'Error on data save',
message: error,
variant: 'error',
}),
);
});
Please try adding the following to your code.
This line is taken from the example in the following document
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.reference_update_record
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. Thank You!
Anudeep
eval("$A.get('e.force:refreshView').fire();");