You need to sign in to do that
Don't have an account?
Saurabh Bisht 8
How to get parentId in lightning action
I was fetching parentId through vfPage before the spring 18 updates, and it was working fine. But i'm not getting it now.... I was using this code..
VF Page:
<apex:page standardController="Custom_Object">
<div id="lightningCmp"/>
<apex:includeLightning />
<script>
var b_id = '{!$CurrentPage.parameters.CF00N5D000000TJgE_lkid}';
console.log('@@@@@@'+b_id);
$Lightning.use("c:TestApp", function() {
$Lightning.createComponent(
"c:TestCmp",
{"parentId":b_id},
"lightningCmp",
function(cmp) {
console.log("##");
//console.log(cmp);
});
});
</script>
</apex:page>
TestCmp:
<aura:attribute name="parentId" type="String"/>
TestController:
var pid = cmp,get("v.parentId");
alert(pid);
Not getting pid ...
I have to override the standard new button in lightning.
Can anyone help???
VF Page:
<apex:page standardController="Custom_Object">
<div id="lightningCmp"/>
<apex:includeLightning />
<script>
var b_id = '{!$CurrentPage.parameters.CF00N5D000000TJgE_lkid}';
console.log('@@@@@@'+b_id);
$Lightning.use("c:TestApp", function() {
$Lightning.createComponent(
"c:TestCmp",
{"parentId":b_id},
"lightningCmp",
function(cmp) {
console.log("##");
//console.log(cmp);
});
});
</script>
</apex:page>
TestCmp:
<aura:attribute name="parentId" type="String"/>
TestController:
var pid = cmp,get("v.parentId");
alert(pid);
Not getting pid ...
I have to override the standard new button in lightning.
Can anyone help???
http://http://sfdcmonkey.com/2017/08/19/display-lightning-component-visualforce-page/
i hope it helps you.
Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others, thanks
sfdcmonkey.com
Hi Piyush ,
Thanks for your quick response... but it didn't work..
I'm not getting anything in b_id;
I think, it's because salesforce has changed it's URL format... and i'm not getting parentId in URL (https://<domainName>...........?CF00N5D000000TJgE_lkid = <parientId>) , which earlier I was getting.
Any alternative for this.....?
because i'm not getting CF00N5D000000TJgE_lkid parameter anymore in the URL
It's urgent .
Thanks in advance.