You need to sign in to do that
Don't have an account?
praveen 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}";
}
}
}
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}";
}
}
}