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
Javier CGJavier CG 

Object-specific quick action to create record but with previous comprobation

I am converting javascript buttons to create records into quick action to get the app in lightning ready.
But some js buttons have previous comprobation. For example: I revise if the sale has previous invoice before create a new one, and if the sale has invoice, a confirmation box ask the user about create a new one or not, and only creates a new invoice if the user say yes.
I don´t know if this kind of functionality can be made it with object-specific quick actions or in any other form.
Can someone help me?
Best Answer chosen by Javier CG
Khan AnasKhan Anas (Salesforce Developers) 
Hi Javier,

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.

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

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 link:

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

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 Javier,

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.

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

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 link:

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

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
Javier CGJavier CG
Thank you Khan.
Finally I could do it after read the links that you send me (especially useful was the last one, that describes the structure of a lightning component with examples).
If someone has the same problem, what I have did:
  1. Created a class to handle the server-side logic. In my case that class query SF through SOQL to know if the LC must show a confirmation warning to the user or not.
  2. Created a LC with the class as controller, look like a confirmation warning window and calls to doInit function of his js controller to do comprobations before anything.
  3. Created the LC controller which calls the class method after the load of the component to make some tests and, according to result, show the LC or open a create record action.