+ Start a Discussion
Alexander Zaytsev 1Alexander Zaytsev 1 

Force refreshView in LWC

In Aura, we can do
to cause standard components to update.

How can we do an equivalent in LWC because sfdx refuses to publish .js code with $A in it saying the usage is disallowed in LWC?

For now i tricked it with 
but that is obviously less than ideal....
Raj VakatiRaj Vakati
If its an apex wire adaptor we can do it using the refreshApex .. but if you want to refresh other standard components  i am not able to find any think in documents 

you can use window.realod() ... 
Alexander Zaytsev 1Alexander Zaytsev 1

is like using a microscope as a hammer.

The force:refreshView is actually implemented by components individually and doesn't cause the full window reload. 

Anil K 85Anil K 85
// import
import { updateRecord } from 'lightning/uiRecordApi';

// a way (WORKAROUND) to refresh data in standard components
updateRecord({ fields: { Id: this.recordId } });
Samuel MSamuel M
Hi Alexander, 
Please follow the below link,
Kindly mark this as best answer so that it will also help others to find the solution
Ramakrishna Reddy GouniRamakrishna Reddy Gouni
Please follow below link
If it is useful for you, then please select as best answer.

Ramakrishna Reddy 
Alejandra ZapataAlejandra Zapata