I have one custom button with Javascript code in Salesforce classic. In Lightning experience, i can not see this button as lightning doesnt support buttons with js code. What i need to do to convert this button to work in lightning? Code on button is-
{!REQUIRESCRIPT("/soap/ajax/9.0/connection.js")}
var count = '{!Contract.Count__c}';
if(count > 300)
window.parent.location.href = "/apex/page1?id={!Contract.Id}";
else
window.parent.location.href = "/apex/page2?id={!Contract.Id}";
URL
and change the formula to:/apex/page{!IF(Contract.Count__c > 300,'2','1')}?id={!Contract.Id}