+ Start a Discussion
LinvioIncLinvioInc 

Can access parent record ID in Lightning component with lightning:actionOverride and "New" button

I've found that when I override the "New" button with a lightning component (implementing lightning:actionOverride), the parent record Id is not accessible to the component.  "RecordId" is of course "null" since it's a "New" action.  With out the parent id, it's impossible to attach the new record propertly.

Is there a way to find the parent Id?  

Thanks,
Ron
Mustafa JhabuawalaMustafa Jhabuawala
Hi Ron,

It is because that when you override the standard button with lightning component it takes to a new link (observe the URL when you click on New button).

So framework is not able to maitain the parent Id.

Work around - Instead of overriding the standard button you can create a action button on the parent itself and can select your lightning component over there where you will also get the parent ID too.

For how to create the action button, click here (https://salesforce.stackexchange.com/questions/179179/sobjectname-and-lightning-quick-action/179252#179252) and refer the screen shots.

Hope you find this helpful.

Note - Kindly mark this answer as best answer if this helped you, so that other's can also get benefit from it.

Thanks,
Mustafa Jhabuawala
Technical Lead at Zen4orce (http://www.zen4orce.com)