You need to sign in to do that
Don't have an account?
Administrator 5
Javascript Buttons Broken
Hello!
We have made the jump to lightning. Our Javascript buttons are now unavailable and the button conversion app says we must manually convert them (I have no idea where to begin with this).
Attached is the button code that we would like to convert to work in lightning.
Essentially the button switched record type from one to another without hitting the edit screen.
I look forward to your expert responses.
Kind regards,
Please find below steps:
1. Create Lightning component which implements 'force:hasRecordId' and define record id attribute.
2. You can fetch the case record from Apex method in Init Method of lightning component using recordId attribute.
3. If it is closed throw an error otherwise call an another apex method which simply updates the recordId.
4. Once the response status is success then reload the page.
Hope above steps helps.
Cheers,
Durgapaavan
Greetings to you!
Please try the below code, I have tested in my org and it is working fine. Kindly modify the code as per your requirement.
Apex:
Component:
Controller:
Add this component to record page. Please refer to the below link which might help you further.
https://trailhead.salesforce.com/en/content/learn/projects/quickstart-lightning-components/quickstart-lightning-components3
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