Refresh lightning component Opportunity page on Stage progress bar

I have a lightning component on the opportunity layout. I want it to refresh on stage change. Currently, it works when you change the stage using the edit button using the following code.

<aura:dependency resource="markup://force:recordSaveSuccess" type="EVENT" />
<aura:handler event="force:refreshView" action="{!c.doInit}" />

enter image description here

When changing stage using the Sales Path component (pic below for reference), this event does not seem to be fired. Has anyone been able to subscribe to this component’s events? Am I missing something?

Answer

When you update the opportunity stage using the Sales Path Component, it shows a toast after the update. You can handle that showToast event and then update your component accordingly.

<aura:dependency resource="markup://force:showToast" type="EVENT" />
<aura:handler event="force:showToast" action="{!c.doInit}" />

Attribution
Source : Link , Question Author : miku , Answer Author : Santanu Halder

Leave a Comment