As Salesforce is disabling the use of JavaScript in Hyperlink function in formula fields, as per this documentation: Hyperlink Formula Fields for JavaScript Disablement

I am working on changing one formula field.

I have created a custom link with Execute JavaScript functionality. But custom links will be displayed at the bottom of the page.

Is there any alternative way where I can get this link on random place on the page layout?

Any suggestion is greatly appreciated.

  • They are not disabling the use of hyperlinks in formula fields. help.salesforce.com/articleView?id=000249336&type=1
    – Eric
    Sep 19, 2017 at 7:01
  • Sorry, I mean eliminating Javascript in Hyperlink function. Currently, I am working on changing the functionality on alternative way. Is there any alternative apart of custom link? where i can get link on any other section on page layout
    – venky
    Sep 19, 2017 at 7:04

1 Answer 1


Its not possible to place a button anywhere in layout. Can be done by a inline page which simply redirects, but it would be an overkill for such a simple requirement.

Possible solutions are mentioned in documentation: Hyperlink Formula Fields for JavaScript Disablement. Quoting from it:

What action do I need to take?

We recommend that admins begin reviewing their use of JavaScript in hyperlink formula fields and migrate to alternative solutions. This critical update is enabled for all orgs on the auto-activation date of October 30, 2017. Here are some possible workarounds.

  1. Create a Custom Button or Link executing JavaScript
    • Create custom buttons or links executing OnClick JavaScript
    • Supported in Salesforce Classic only
  2. Create a Lightning Experience Quick Action
    • Create JavaScript in a Lightning Experience component that can be executed though a Quick Action button
    • Supported in Lightning Experience only
  3. Create a custom Visualforce Page to redirect to the correct URL
    • If there is a client-side conditional logic to be executed to decide the link to which the user needs to be directed, create an empty Visualforce page and an Apex controller. Pass the required values from the link to controller, execute the logic to decide the URL in controller method and perform the redirect.

We recommend that you test this update in a sandbox or Developer Edition org. Check the behavior of the HYPERLINK function in formula fields.

Based on where you need to execute this action, you have these options.

You must log in to answer this question.

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