Activity Forums Salesforce® Discussions Onclick Javascript is not working in Salesforce Lightning?

  • Onclick Javascript is not working in Salesforce Lightning?

  • Shubham

    April 26, 2018 at 5:15 pm

    Onclick Javascript not working in lightning? Please provide an alternative solution.

  • Manpreet

    April 26, 2018 at 5:22 pm

    Hi shubham,

    Unfortunately, Javascript buttons are not supported in Lightning Experience.
    However, Salesforce has provided alternatives for these buttons based on the use cases for which we implement these buttons.
    Alternative: Custom URL Buttons


  • Aman

    April 26, 2018 at 6:41 pm

    Hi Shubham,

    Javascript buttons are no longer supported by salesforce but you can use custom url buttons as their replacement.

    Custom URL buttons are suitable substitutes for JavaScript buttons that direct to a page on an external website or that navigate to a different record in Salesforce. For internal Salesforce links, use the URLFOR function and $Action functions or Relative Salesforce URLs (e.g. /{!Contact.Id}) rather than hard-coded URLs (e.g.{!Contact.ID}) to keep your users from getting directed out of Lightning Experience. You can update a JavaScript button to a Custom URL button by updating the Content Source for your button from OnClick JavaScript to URL,

Viewing 1 - 3 of 3 posts

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos