Retrieve related id / parent id in Aura component when override standard New button
Currently this is not possible , please vote the idea
Get parentId when overriding standard actions with a lightning components
This currently doable by overriding New button using Visualforce page. So we can retrieve Parent Id or any record field in Visualforce page and pass it to the Aura component.The workaround that works is by wrapping it inside Visualforce page.
Basically it is the same for both Aura and LWC but I still put it here for my reference
Example for Aura component
Example for LWC
Useful Link :
Hope this helps.
Get parentId when overriding standard actions with a lightning components
This currently doable by overriding New button using Visualforce page. So we can retrieve Parent Id or any record field in Visualforce page and pass it to the Aura component.The workaround that works is by wrapping it inside Visualforce page.
Basically it is the same for both Aura and LWC but I still put it here for my reference
Example for Aura component
<apex:page standardController="MyObject"> <apex:includeLightning /> <div id="lightning" /> <script> $Lightning.use("c:lightApp", function() { $Lightning.createComponent("c:lightComp", { opportunityId:"{!MyObject.Opportunity__c}" },/*** here my parentId***/ "lightning", function(cmp) { // do some stuff } ); }); </script> </apex:page>
Example for LWC
<apex:page standardController="MyObject"> <apex:includeLightning /> <div id="lightning" /> <script> $Lightning.use("c:lightApp", function() { $Lightning.createComponent("c:lightLWC", { opportunityId:"{!MyObject.Opportunity__c}" },/*** here my parentId***/ "lightning", function(cmp) { // do some stuff } ); }); </script> </apex:page>
Useful Link :
Hope this helps.
Comments
Post a Comment