20

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?

23
+300

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}" />
  • 7
    This question has won the award as the best answer from the 1st quarter of 2017. – Adrian Larson Apr 17 '17 at 10:58
  • 2
    Wow. This feels so great! Thanks Adrian. Also, thank you @SE_User, I hope you see this comment, I am not able to comment on the meta post. – Santanu Halder Apr 17 '17 at 13:59
  • Yeah, I lock it once voting closes so no one can place further votes, but that also prevents comments. – Adrian Larson Apr 17 '17 at 14:07
  • 1
    You're welcome, @SantanuHalder. (y) :) – SE_User Apr 19 '17 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.