function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ali FailoulAli Failoul 

Custom Button or Link Lightning Experience

// Include and initialize the AJAX toolkit library 
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}; 
{!REQUIRESCRIPT("/soap/ajax/19.0/apex.js")};
var idList = {!GETRECORDIDS($ObjectType.Opportunity)}; 
var retURL = window.location.toString();
var proceed = true;
if(idList.length <= 0){
    alert('Please select record(s).');
    proceed = false;
}   
if ((navigator.userAgent.indexOf('MSIE')) >= 0) {
    if(idList.length > 100){
        alert('Only maximum of 100 records can be selected.');
        proceed = false;
    }   
}
if(proceed){
    window.location="/apex/ABSI_Mass_Task_Action?objIds=" + idList + "&retURL=" + retURL;
}
this one not working on SF Lightning 
 
Best Answer chosen by Ali Failoul
Khan AnasKhan Anas (Salesforce Developers) 
Hi Ali,

Greetings to you!

It is an Idea (https://success.salesforce.com/ideaView?id=08730000000cGX8AAM) to support Javascript Buttons in Lightning Experience.

However, you can use Lightning Experience Configuration Converter to convert JavaScript buttons to lightning. Please refer to the below links which might help you further with the above issue.

https://developer.salesforce.com/blogs/2018/06/convert-javascript-buttons-to-lightning-friendly-alternatives-with-the-lightning-experience-configuration-converter.html

https://help.salesforce.com/articleView?id=lcc_considerations.htm&type=5 (https://help.salesforce.com/articleView?id=lcc_considerations.htm&type=5)

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

There are other options also to replace the javascript button in lightning. You can use Quick Actions, Custom Buttons, or Apex. Go through this trailhead module to understand the alternatives available:
Lightning Alternatives to JavaScript Buttons (https://trailhead.salesforce.com/en/modules/lex_javascript_button_migration)

Also, please refer to the below link:

https://www.bayforce.com/wp-content/uploads/2017/10/Bayforce-JavaScript-Lightning-Experience-White-Paper.pdf

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas