I have a lwc component that used apex controller on account page when the account updated, my component is not refreshing with latest data updated on account. Is there any listener available in lwc?
handleUpdate() something like?
Code:
import { LightningElement, api, wire, track } from "lwc";
import { refreshApex } from '@salesforce/apex';
import getAccount from "@salesforce/apex/AccountHealthCheckController.getAccount";
refreshApex(this.account); //ERROR
refreshApex(getAccount); //ERROR
export default class AccountHealthChecklwc extends LightningElement {
@api recordId;
@track account;
@track error;
@wire(getAccount, { accountId: "$recordId" })
wiredGetAccount({ error, data }) {
if (data) {
this.error = undefined;
this.validationMessages( data );
console.log(this.summary);
} else if (error) {
this.error = error;
this.account = undefined;
}
}
validationMessages( value ) {
this.account = value;
//LOGIC
}
}