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
Frank CarterFrank Carter 

Javascript Button to Lightning

Hello,

I need help. I have 2 Javascript Button which opens a visualforce page.
Now the problem is I don't know how to proceed. I read  this document  but I don't understand Hot to go on.
One of the javascript button code:
if ("{!ISPICKVAL(Opportunity.Demand_Activity_Stage__c,'Involved')}" != "true" && (("{!Opportunity.Opportunity_Type__c}" == "Delivery") || ("{!Opportunity.Opportunity_Type_def__c}" == "Partner") || ("{!Opportunity.Opportunity_Type_def__c}" == "Partner Direct")))
window.location.href = "/apex/Involve_PreSales?Id={!Opportunity.Id}";
//else if ("{!(Opportunity.Opportunity_Type_def__c)}" == 'Partner Direct')
//alert("You cannot involve PreSales for Partner Direct Opportunity");
else if ("{!(Opportunity.Demand_Activity_Stage__c)}" == "Involved")
alert("The PreSales has already been involved");
What I have to do?
I think I have to edit the button to Visualforce Page instead of onclik Javascript. is It Correct?
This code (Javascript) seems like conditions to open the visualforce page. Where I must put this conditions? in Controller of the vf page?
Can anyone help me explaining me how to proceed in this case?

Thanks,
Frank


Best Answer chosen by Frank Carter
Frank CarterFrank Carter
Hello, I solved the problem replacing the javascript button with a button with "Content Source Visualforce Page". Then I  create a vf page with inline javascript code inside the tag <script type = "text/javascript">.  

All Answers

Sascha LöfflerSascha Löffler
Hi Frank, you can try out the new Lightning Experience Configuration Converter.
Maybe it helps you to convert you JavaScript Buttons 

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

Best regards
Frank CarterFrank Carter
I tried but nothing, Thank 
Frank CarterFrank Carter
Someone can help me?

Thanks,
Frank
Frank CarterFrank Carter
No one can help me?

Thanks,
Frank
Frank CarterFrank Carter
Hello, I solved the problem replacing the javascript button with a button with "Content Source Visualforce Page". Then I  create a vf page with inline javascript code inside the tag <script type = "text/javascript">.  
This was selected as the best answer