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
Mandy RawatMandy Rawat 

Need help in converting a javaScript Button into lightning component button. Javascript button using visual force pages. The apex controller method calling webservice using Continuation.

Need help in converting a javaScript Button into lightning component button.
There is a JavaScript button, which I need to convert into lightning component button.
{!REQUIRESCRIPT("/xdomain/xdomain.js")} 
{!REQUIRESCRIPT("/support/console/37.0/integration.js")} 
{!REQUIRESCRIPT("/apex/VFPage1")} 
VFPage1.showLoadingIndicator();
VFPage1.initRequest("../apex/VFPage2?accId={!Account.Id}&guid={!Account.customfield__c}",'StringValue', function(message) { alert(message); },"../{!Account.Id}");
 
VFPage1 page   contentType="text/javascript" has custom javaScript functions in it
( showLoadingIndicator(), initRequest() etc...)
 
 VFPage2  is communicating with Apex Class Controller methods. None of the controller methods are Static.
One of the method is calling the inhouse webservice  using
Continuation con = new Continuation(InhouseService.WebserviceCalloutTimeout);
Raj VakatiRaj Vakati
You need to use the Lightning Experience Configuration Converter 

https://lightning-configuration.salesforce.com/

https://developer.salesforce.com/blogs/2018/06/convert-javascript-buttons-to-lightning-friendly-alternatives-with-the-lightning-experience-configuration-converter.html




Convert JavaScript Buttons to Lightning-Friendly Alternatives with the Lightning Experience Configuration Converter