On the Account record page, I want to refresh my LWC page whenever I create or edit a related contact record. My LWC page is fetching list records from apex not using LDS.
I couldn't think of any way to achieve the same so I thought of wrapping my LWC in the aura and use the below aura code.
<aura:component implements="flexipage:availableForRecordHome">
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:dependency resource="markup://force:editRecord" type="EVENT" />
<aura:handler event="force:refreshView" action="{!c.doInit}" />
</aura:component>
JS:
doInit: function (component, event, helper) {
console.log('from aura');
},
I get a console log when I edit the account record but don't get anything when I edit the contact record from the related list of account.
is there any way I can detect if a record is created or updated from the related list either in lwc or aura?