I'm trying to Navigate to an edit page of a specific record which is part of a line item (list of records displayed) on a Lightning component which is embedded as a VF page on detail page of a standard object.
force:navigateToURL
does not work as it comes from an embedded VF page.
e.force
doesn't work either.
I tried URLFOR
, but unable to get $Action.Lead
to work on the Lightning component.
Code details :
The VF page embedded on the detail page of a Lead layout uses the following code format:
<apex:page standardController="Lead">
<apex:includeLightning />
<div id="lightning" />
<script>
$Lightning.use("c:RelatedLists", function() {
$Lightning.createComponent("c:RelatedListsComponent",
{ objectId : '{!Lead.Id}'
},
"lightning",
function(cmp) {
});
});
</script>
</apex:page>
Lets say your displaying a list of leads in the c:RelatedListsComponent and for each lead I want to add an edit ui:button/ ui:outputURL on clicking it should redirect the user to the edit page of the specific lead that was clicked on.
As mentioned, earlier methods don't work because this component comes from an embedded VF page.
Also, a little bit about what I'm trying to develop:
A generic custom related list using the Lightning Components, so for reference you can look at the existing standard related list in Lightning User experience, this is only for lightning and not the classic salesforce related list.
You can see how there is an arrow next to each record on the related list, clicking which gives the drop down, and the 'Edit' and 'Delete' button, I'm stuck at this part where I can not implement the Edit functionality.
Best Answer
force:navigateToURL doesn't work in a VF. You need to use sforce.one.navigateToURL.