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
praveen jha 42praveen jha 42 

Migrating Java script button to lightning

I have requirement where I have to replicate a javascript button for Lightning version. As we know, we cannot have Javascript button in Lightning. I'd like to have the same button in Lightning version. Below is the Javascript code for the button in Classic version.
Note:- Lightning Configuration Convertor doesn't work as it is partially convert not fully

Any help is appreciated!

Many Thanks!


{!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/39.0/apex.js")} 


if("{!$Profile.Name}" == "System Administrator") 


if (confirm("Are you sure you want to Create an Account in Oracle?") == true) 


var acctObj = new sforce.SObject("Account"); 
acctObj.Id = '{!Account.Id}'; 

acctObj.Create_Account_in_Oracle__c = true; 

var result = sforce.connection.update([acctObj]); 

if (result[0].success=='false') 

alert(result[0].errors.message); 

else 

alert("Account Creation Process has been submitted to Oracle"); 
window.parent.location.href="/{!Account.Id}"; 



}