I have a lightning component which handles a event and performs subsequent dml operations. Once this is done, a toast message is displayed (success/ error etc.)
I want to refresh the entire browser window after this. I tried force:refreshView, but it just refreshes the component.
Any help? 🙂
Best Answer
You can use standard JS way -
Please note you have to make a property call from window object obligately (not just location.reload()) because Lightning LockerService treats the global namespace differently and the window object there is a special wrapper around original one.
Have tested it inside one of my Lightning components under Chrome and IE 11 - it works.
As an alternative (but not recommended), you can try the old Lightning way with refresh event:
documentation is here
https://developer.salesforce.com/docs/atlas.en-us.212.0.lightning.meta/lightning/ref_force_refreshView.htm
But from my experience, it works smoothly not everywhere,
e.g. I encountered the next issue in one of the places:
and there is no documentation entries for this event on API v43 and v44.