+ Start a Discussion
Xeon ArianXeon Arian 

Onclick Javascript not working in lightning

Hi ,

I am trying to create a custom button that will use onclick javascript but the button is not available in lightning . I know that lightning does not support onclick javascript. Can anyone help me with this issue by providing a replacement for it in lightning? Below is the code I am using in onclick javascript.
 
{!REQUIRESCRIPT("/soap/ajax/18.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/18.0/apex.js")}

 window.open('/apex/GetReport?OpportunityId='+'{!Opportunity.Id}','_self')

Thanks
LBKLBK
Hi Xeon,

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.

Please refer the following blog.

https://developer.salesforce.com/blogs/developer-relations/2016/09/take-the-first-steps-ways-you-can-replace-javascript-buttons.html

Hope this helps.