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
Raymond AireyRaymond Airey 

Converting Javascript button for Lighting

Hi All,

We currently use the classic version of Salesforce but are looking into moving to the Lighting platform. One of the things that is holding us back in that we currently have a javascript button on the Opportunities page which when clicked, creates an EDI file in the background that is sent for processing in an external system.

Below is the code currently used in the Javascript button:
var result = sforce.apex.execute("orderOutput","generate", {genericId:"{!Opportunity.Id}"}); 
window.alert(result ); 
Does anyone have any ideas what or how I could convert this into something compatible with Lightning?

Appreciate any help or guidance,

SandhyaSandhya (Salesforce Developers) 
Hi Raymond Airey,

You cannot use javascript buttons in Lighting,instead you need to create button component and make use of it.

 Please refer below links to get more information on creating button component.

 Hope this helps you!

Thanks and Regards