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
Sahba Shabrokh 3Sahba Shabrokh 3 

How to convert a detailed URL button into a lightning component?

Hi all,

I need more flexibility in the lightning component aspect of SF and i am relativity new in this.

how can i convert this detailed URL button into a lightning component: 

/apex/echosign_dev1__AgreementTemplateProcess?masterId={!Quote.Id}&templateId=a2a1p00000667Xw

Just a background to this: since lighting you cannot use java script to validate a button. With lightning component you can use lightning record pages to hide components based on criteria.
Best Answer chosen by Sahba Shabrokh 3
Khan AnasKhan Anas (Salesforce Developers) 
Hi Sahba,

Greetings to you!

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:

https://www.bayforce.com/wp-content/uploads/2017/10/Bayforce-JavaScript-Lightning-Experience-White-Paper.pdf

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

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

https://help.salesforce.com/articleView?id=lcc_considerations.htm&type=5

https://developer.salesforce.com/blogs/developer-relations/2016/09/take-the-first-steps-ways-you-can-replace-javascript-buttons.html


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 the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi Sahba,

Greetings to you!

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:

https://www.bayforce.com/wp-content/uploads/2017/10/Bayforce-JavaScript-Lightning-Experience-White-Paper.pdf

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

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

https://help.salesforce.com/articleView?id=lcc_considerations.htm&type=5

https://developer.salesforce.com/blogs/developer-relations/2016/09/take-the-first-steps-ways-you-can-replace-javascript-buttons.html


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 the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
This was selected as the best answer
Raj VakatiRaj Vakati
You no need to write the code for this one ..use the Lightning Experience Configuration Converter that generated the code for you 

The Lightning Experience Configuration Converter recreates your org’s JavaScript buttons as Lightning components, quick actions, or other solutions — all without touching your original buttons. Before committing to any changes, you can preview the new component code or declarative steps and verify that the alternatives work as expected.

Here is the link 

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
Sahba Shabrokh 3Sahba Shabrokh 3
Hey both, Unfortuntly the Java converter button didnt work for the instance. Seems as though a custom coding solution is required.
Sudhir varmaSudhir varma
Hi Sahba,

I am surprised that I am facing the same issue as you have. I too want to covert my URL. Did you get any solution or workaround to achieve this? If yes, Could you please share the converted lightning code for the same?

My URL:
{!URLFOR('/apex/echosign_dev1__AgreementTemplateProcess', null, [masterId = CustomObj__c.Id, templateId=Application__c.Adobe_EP_ID__c] )}

Thank you so much in advance.

Thanks & Regards,
Sudheer.
Sahana Shekar 7Sahana Shekar 7
Hi,
did you find the resolution for this issue.
Can you please post your findings. I am also in a similar issue. Will keep you updated on the same.
Thanks