You need to sign in to do that
Don't have an account?
jnegi
Lightning Event inside VF page
Hi All,
I am using lighning component in VF page using lightning out. Created simple datatable with Edit and Del option for each record. Now when I click on Edit link on each row, able to pass selected record Id to controller however not able to use below event code to edit the record. Getting undefined in console.log.
var editRecordEvent = $A.get("e.force:editRecord");
console.log('***JN***'+editRecordEvent);
editRecordEvent.setParams({
"recordId": recId // recId is populating correctly
});
editRecordEvent.fire();
Any idea?
Thanks
Jagmohan
I am using lighning component in VF page using lightning out. Created simple datatable with Edit and Del option for each record. Now when I click on Edit link on each row, able to pass selected record Id to controller however not able to use below event code to edit the record. Getting undefined in console.log.
var editRecordEvent = $A.get("e.force:editRecord");
console.log('***JN***'+editRecordEvent);
editRecordEvent.setParams({
"recordId": recId // recId is populating correctly
});
editRecordEvent.fire();
Any idea?
Thanks
Jagmohan
The documentation refers that the event is handled by "one.app" container and works only in in Lightning Experience, the Salesforce app, and Lightning communities. https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_editRecord.htm
You may further refer to this links for pointers:
https://salesforce.stackexchange.com/questions/152428/lightning-events-in-force-namespace-dont-work-inside-of-a-visualforce-page
Thanks,
Jayant
All Answers
The documentation refers that the event is handled by "one.app" container and works only in in Lightning Experience, the Salesforce app, and Lightning communities. https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_editRecord.htm
You may further refer to this links for pointers:
https://salesforce.stackexchange.com/questions/152428/lightning-events-in-force-namespace-dont-work-inside-of-a-visualforce-page
Thanks,
Jayant
with visualforce page in lightning component you need to use
just replace code with
Regards
Ashif
check out below link
http://cloudyworlds.blogspot.in/2016/02/lightning-events-via-visualforce.html
let us know if it helps you and mark it best if it helps you
Thanks,
Bhanu Prakash
visit ForceLearn (https://www.forcelearn.com) for salesforce Latest Updates and development tips