0

I have a lightning component which is residing in a lightning record home page of a custom object. If I modify any fields, usually Salesforce fires refreshView event and we can consume the event in our component and act accordingly. But refreshView event is not getting fired for custom object record pages. If I put the same component in Standard object pages like Account, it is firing the refreshView event and I'm able to consume it. Any thoughts about what I'm missing here? I know the work around, but I just want to know why this approach is failing

Here is the code

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction,lightning:isUrlAddressable">
    <aura:handler event="force:refreshView" action="{!c.doSomething}"/>

</aura:component>

<!-- Handler -->
({
  doSomething: function(component, event, helper) {
      alert('PAGE REFRESHED');
  }
});

The code works fine, only thing which is not working is, when i embed the component in custom object record detail page.

  • can you show how are you handling refresh view event in component? – salesforce-sas Jul 26 at 4:33
  • The code works for standard object record detail page, but not for custom record detail page. It used to work, but stopped working suddenly. Anyway I have added the snippet. Please let me know if you have any suggestions. – Manjunatha V P Jul 26 at 4:45
0

What you are showing should work. As you said it was working before but suddenly stopped, i believe it is not problem of API version either. The only scenario which I can think of is you may have implemented another component in custom object record page which is firing another application event like createRecord or navigation. There is a priority given to each application event where one application event may cancel another. So, you can start debugging/checking from that aspect.

  • No, that's the only component in my page – Manjunatha V P Jul 26 at 5:51

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.