0

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. Edit Button drop down

  • The good way to get most out of this community is post some code ,show some screenshots on what you are expecting and whats not working .Please add in details .Thanks – Mohith Shrivastava Feb 10 '16 at 22:55
  • try javascript .if it helps. – Tushar Sharma Feb 11 '16 at 2:24
0

force:navigateToURL doesn't work in a VF. You need to use sforce.one.navigateToURL.

  • I meant to say "sforce.one.navigateToURL" , was a typo, and it doesn't work – Sham PTC Feb 22 '16 at 21:32
0

Use url creation in JS as we used to do in classic UI, good thing about lightning is it recognizes the classic UI URLs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.