5

How can I add a link to the sidebar component that opens a VF page in a new page? I have created a custom page component and a custom link like apex/myPageName but it does not work.

1
  • I guess it should be /apex/pagename .Please recheck your URL link. Commented Dec 4, 2012 at 13:20

2 Answers 2

3

When creating your Link you can pick the Visualforce page source like so...

enter image description here

Then assign the Link to a component...

enter image description here

And finally to the layout...

enter image description here

My page shows in the sidebar like so and popups up in a new window...

enter image description here

Like so...

enter image description here

My page source is this, note I've removed the sidebar and header...

<apex:page sidebar="false" showHeader="false" >
  <!-- Begin Default Content REMOVE THIS -->
  <h1>Congratulations</h1>
  This is your new Page shown via the Sidebar
  <!-- End Default Content REMOVE THIS -->
</apex:page>
1
  • Is there any way to have multiple options under "My Sidebar Pages", which in turn do different things when clicked based on the contents of your VF page? Or do I have to create a separate VF page for each link?
    – JWiley
    Commented Mar 4, 2016 at 17:02
2

Specify your full URL (eg https://na1.salesforce.com/apex/pagename) for the link.

It's nice to put that prefix in a custom setting so it'll work in sandboxes, after a move, etc.

And as always, verify permissions on the page.

2
  • It's even nicer to specify the prefix without the hardcoded instance ;) Relative url like "/apex/pagename" ;)
    – eyescream
    Commented Dec 4, 2012 at 13:16
  • Agreed with eyescream Commented Dec 4, 2012 at 13:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .