+ Start a Discussion

Javascript migration button

Hi Team

Iam trying migrate javascript button into lightnig component need some help to design it stucked on 

if ({!NOT(ISNULL(Lead.Email))}) {
alert("Lead email is created");
} else if ({!Lead.phone = true}) {
alert("Lead phone number is validate");
} else if({!Lead.Status = false}) { 
alert("Lead status is false.");
} else if({!Lead.Status = true} && {!Lead.stage = true}) { 
alert("Lead has been create sucessfully");
} else { var msg = sforce.apex.execute("LeadWebClass","sendMailToLead",{LeadID:"{!Lead.Id}"}); 
Thanks for advance
Khan AnasKhan Anas (Salesforce Developers) 
Hi Bhanu,

I trust you are doing very well.

You can use Lightning Experience Configuration Converter to convert JavaScript buttons to lightning. Please refer to the below links which might help you further with the above issue.




There are other options also to replace the javascript button in lightning. You can use Quick Actions, Custom Buttons, or Apex. Go through this trailhead module to understand the alternatives available:
Lightning Alternatives to JavaScript Buttons (https://trailhead.salesforce.com/en/modules/lex_javascript_button_migration)

Also, Please refer to the below links:


I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in future.

Thanks and Regards,
Khan Anas