4

So I have a Lightning component on a Lightning detail page. Whenever a user updates some value on the record, I want to refresh this component. Basically want to pull in some fields based on the changed values.

But how to find out that a save event has occurred. The save is not in any of my components where I can fire an event. This is the standard save feature of salesforce.

I tried this, but this handler keeps getting called even if nothing is done.

<aura:handler name="change" value="{!v.oppty.StageName}" action="{!c.refreshPage}"/>  

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_aura_valueChange.htm

What am I doing wrong? Any other way to do achieve this?

EDIT

Ok finally this worked for me

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

But I uncovered another issue on the Opportunity page. This event does not fire when I change the Stage on the standard Sales path component. But it does fire when I edit the record by clicking the "Edit" button and then saving the record.

Seems to be an inconsistent behavior. Anyone else notice this issue?

Your Answer

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

Browse other questions tagged or ask your own question.