2

I am on a record page and have an overridden 'New' standard action for a related list (child object). I am trying to get the record Id from the current page as the parent Id when I click 'New' from the related list. This piece of code was working until the salesforce Summer21 release happened. Can someone please suggest a workaround for this issue?

Component: 
<aura:component implements="lightning:isUrlAddressable"></aura:component>

JS: 

doInit : function(component) {
let pageRef = component.get("v.pageReference");
let state = pageRef.state; //returns state - {"count":"1"}
let base64Context = state.inContextOfRef; //returns undefined
            
if (base64Context.startsWith("1\.")) {
    base64Context = base64Context.substring(2);
}
let addressableContext = JSON.parse(window.atob(base64Context));

component.set("v.parentId", addressableContext.attributes.recordId); //earlier this used to return the record Id of the page from which I clicked 'New' from related list. 
}

0

You must log in to answer this question.