function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kiran Jain 15Kiran Jain 15 

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

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)

Hope this help!