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
mahamed raheemmahamed raheem 

refresh the lwc component

I have to refresh the LWC component not the complete page
My scenario is once the record is updated i have to refresh the component.
i have tried below but its not working,

 eval("$A.get('e.force:refreshView').fire()");

My LWC component on the service console page
David Zhu 🔥David Zhu 🔥
Please use the followings:
1. Import refreshApex method.
     import { refreshApex } from '@salesforce/apex';
2. In the place you want to refresh.
     refreshApex(this.yourRecord);    
 Note: yourRecord usually links to @wire method to pull the data from Salesforce.

 
AnudeepAnudeep (Salesforce Developers) 
You can try using a new private _refreshView function shown in this answer or look at refreshApex()