1

Since we can't override Standard button NEW with LWC , i'm calling my LWC from Aura component The button NEW is placed on related list , on click it opens the form in new Tab (limit Salesforce) ,

LWC JS :

handleSuccess(event) {
        event.preventDefault();
        this.handleCancel();

    }
handleCancel(event) {
        this.dispatchEvent(new CustomEvent('cancelo'));
    }

Aura HTML :

<aura:component
    implements="lightning:actionOverride,force:lightningQuickAction,force:hasRecordId,force:appHostable,flexipage:availableForRecordHome,force:refreshView,force:hasSObjectName"
    access="global">

    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <aura:attribute name="parentRecordId" type="String" />

    <c:activityPortefeuilleStandardList oncancelo="{!c.handleCancel}" isModalOpen="true" recordId="{!v.parentRecordId}">
    </c:activityPortefeuilleStandardList>

</aura:component>

Aura JS :

handleCancel: function (component, event, helper) {
        $A.get('e.force:refreshView').fire();
        console.log('Aura cancel');
        var url = window.location.href;
        var value = url.substr(0,url.lastIndexOf('/') + 1);
        window.history.back();
        return false;
    }

So , when i create new record it should return back to previous page and Refresh the standard list View , the refresh doesn't work .. i tried to call the cancel on the LWC itself RefreshEvent in LWC and it didn't worked too

Any idea?

2
  • If you are still facing this issue, put the complete code of lwc and aura component to get the better understanding of this problem. Commented Apr 4 at 10:46
  • that code describe what i'm facing
    – Fark
    Commented Apr 4 at 21:04

0

You must log in to answer this question.