Skip to main content

Posts

Showing posts with the label get parent Id in aura component when action/New button is overridden

How to get parent record Id from URL and pass to LWC component ?

Use Case - Lets assume we have custom child object named "TRW__c" to parent Lead. you need to override New button of  TRW object. Unfortunately we cant override New button with LWC, then aura is suggested approach.  Some other approach is use intermediate Visualfoce page then use lighting-out features. I'm going to explain how to use LWC component wrapped inside aura. Challenge - We will not get Lead record Id easily unlike we get if component is being used as global action. {!v.recordId} Here is the workaround to get parent record id and pass to your LWC. This will be useful when your standard button/action is overridden. LWC component name - createBAFormLWC < template >       < template   if : true = { loading } >          < lightning-spinner ></ lightning-spinner >      </ template >      < div >  BA form Id...