I am trying to convert the Salesforce Classic Javascript button to Lightning Experience. The button has a custom URL. I don't know how to replace the custom URL in lightning. The button uses the connection query and some alert as well.
Please let me know how to convert the Javascript button to Lightning Experience.
Below is the Javascript button code:
{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
var result = sforce.connection.query("Select id,Name,Geocoding_Status__c from Account where id = '{!Account.Id}'");
var accountRecords = result.getArray("records");
var arrayLength = accountRecords.length;
if(arrayLength>0){
for(var i=0;i<arrayLength;i++){
if(accountRecords[i].Geocoding_Status__c=='OK'){
var r = confirm('This will retrieve data from our data partner, Core Logic. Press OK to confirm.');
if(r==true){
var LeinCheck = sforce.apex.execute('LeinCheckCoreLogicIntegration','CoreLogicCallout',{id:'{!Account.Id}',conID:'{!Contact.Id}'});
sforce.debug.trace = true;
location.reload(true);
}else{
}
}else{
alert('Please correct the Account address for this Contact. Lien Check requires a valid address.');
}
}
}
Thank You
{}
to make it code formatting