Lightning Components: how to use events to detect record updates?

I have a custom Lightning Component sitting on a Flexipage for e.g. Account. Now I want to register an handler, which will be invoked each time, the record is updated. Updates might happen via

  • standard Record Detail component on the same Flexipage
  • other custom components on the same Flexipage
  • triggers

What’s the best way to detect and handle as many of these updates as possible?

I’ve tried so far:

<aura:handler name="onUpdated" event="force:recordUpdated"action="{!}" />
<aura:handler name="onSaveSuccess" event="force:recordSaveSuccess" action="{!}"/>


events : function(cmp, evt, hlp){
    console.log('EVENTS :: ',evt.getName(),evt.getParams());

but nothing in the console so far. Any ideas?


Actually I’m using the event force:refreshView which is doing what I want:

<aura:handler event="force:refreshView" action="{!c.forceRefreshViewHandler}"/>

and in the controller

forceRefreshViewHandler : function(cmp, evt, hlp){
    // your logic here

If my stuff is making an update, which the flexipage should update on, I’m firing the very same event


Tricky part is, if two components are updating each others: then you have to set a flag or something to prevent endless loops.

Lots of Salesforce Standard components are firing and listening for this event, so it’s pretty useful.


  • updates made by triggers or API integrations probably get NOT detected
  • updates made by components not firing force:refreshView are not detected

Source : Link , Question Author : Uwe Heim , Answer Author : Uwe Heim

Leave a Comment