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
RAM AnisettiRAM Anisetti 

Alternative to on click JavaScript Button in Lightning Experience

Hi Experts,
We have a Custom Button(on click JavaScript Button) on Lead and sending lead information to third party through executing custom soap webservice class .Depends on the result ,we are showing sucess message.
But Lightning Experience is not supported onclick JavaScript Buttons.
Can any one guide us best approach to execute the same functionality in lighting.

My sample click JavaScript Button code is
 
{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")} 
Var a;

accnt.Id = '{!Lead.Id}';
var r = confirm("you sure want to send it ?");
if(r == true)
{
a = sforce.apex.execute("sendLeadInfo_service", "sendInfo", {
ids: "{!Lead.Id}",
Type: 'Lead'
}, {
onSuccess: refreshList,
onFailure: handleError
});

var refreshList = function(a) {
if(a==true){
alert('success message');

window.location.reload(); 
}
}
var handleError = function() {
alert('Oops! Something went wrong. ');
}
}



 
Robert TRobert T
I have the same question.