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 

need help to write the lightning component for classic java script button

need help to write the lightning component for below  classic java script button

{!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}"; 



}
Raj VakatiRaj Vakati
Lightning Experience Configuration  to convert and generate the code 



Are JavaScript buttons getting in the way of your move to Lightning Experience? The Lightning Experience Configuration Converter can help. With just a few clicks, this new tool scans your org for simple JavaScript buttons, converts them to point-and-click alternatives, and then deploys everything right to your org.



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

https://admin.salesforce.com/lightning-experience-configuration-converter

https://help.salesforce.com/articleView?id=lcc_javascript_buttons_overview.htm&type=5

https://trailhead.salesforce.com/en/content/learn/modules/lex_javascript_button_migration
 
praveen jha 42praveen jha 42
configuration convertor will partially convert not fully.