For the package configuration, I need a Salesforce 'custom link'.
The 'custom link' has to open in a new window.
I need JavaScript for it.
I tried it with following code but it does not work:


Is there a way I can get this working (with JavaScript)?

Edit: I tried it in a VF-Page, but it should also work in lightning.
Edit2: I have a strong feeling that it is not possible to use JS for a package configuration link (I tried the 'custom link' on the home tab and it was working there).

  • Is it a VF page or Lightning? Apr 27, 2017 at 7:08
  • @PranayJaiswal please see the edit.
    – noBillSide
    Apr 27, 2017 at 7:10

2 Answers 2


Is it okay to achieve this without JS?

When you create a custom link you can select always open in New Window/tab it will always open in new window irrespective of your environment(Classic/Lightning)

enter image description here


Since it strongly seems that it is not possible to use 'OnClick JavaScript' for a package configuration link:

A possible solution would be to use a 'Visual Force' page (for 'Custom Link').
Inside this 'Visual Force' page, there could be either a JS script with a redirect to the external page or an HTML link to the external page.

You must log in to answer this question.

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