You need to sign in to do that
Don't have an account?

How to refresh lwc when any change is occurred in apex
Hi Experts,
I am finding a solution of How to refresh lwc when any change is occurred in apex. In Lwc Component I am showing Contact records and I want to auto refresh when any changes is occurred in Apex.
I have no any apex class linked by lwc. my Lwc is inDepandent.
when I click a button at that time my Cmp is refreshing and getting new records but When any update is occurred in apex (LIke Via Trigger or user doing query and manually update records in apex) at that time my Lwc automatic get refresh.
I hope someone will help me.
I will be greatfull.
Thanks In Advance
I am finding a solution of How to refresh lwc when any change is occurred in apex. In Lwc Component I am showing Contact records and I want to auto refresh when any changes is occurred in Apex.
I have no any apex class linked by lwc. my Lwc is inDepandent.
when I click a button at that time my Cmp is refreshing and getting new records but When any update is occurred in apex (LIke Via Trigger or user doing query and manually update records in apex) at that time my Lwc automatic get refresh.
I hope someone will help me.
I will be greatfull.
Thanks In Advance
Hi Kiran,
Corresponding to this, you may need to have apex class and can use @track decorator to fetch latest changes in you LWC. If you aren't not using any apex class then you might check the below link: (but it works only if record is updated on Record Page)
https://salesforce.stackexchange.com/questions/274390/how-to-get-an-lwc-component-on-a-record-page-to-refresh-when-that-page-is-update
Hope this help!
Thanks
Sucharita