You need to sign in to do that
Don't have an account?
KPJS
Need to create a Lightning Button that does nothing
Hello - we have a LOT of buttons for the same purpose: a series of contracts buttons, on the Account object. My manager didn't want them all running across the page so I have them all in the drop down menu. He then asked me to create a fake button that pointed users to the menu, it reads Contracts >, best I could do, but people are clicking on it, which just creates an error.
So, does anyone know how to create a button that either does nothing without erroring, or just keeps them on the existing Account? I tried using {!Account.Id} or Account.Link, but it just appends the existing URL with this link. I do have it set to Display in existing window without sidebar.
Anyway, any ideas would be welcome. Thanks!
So, does anyone know how to create a button that either does nothing without erroring, or just keeps them on the existing Account? I tried using {!Account.Id} or Account.Link, but it just appends the existing URL with this link. I do have it set to Display in existing window without sidebar.
Anyway, any ideas would be welcome. Thanks!
Greetings!
You can create the lightning component to refresh the page on button click using force:refreshView which just refresh the page without making any changes.
Reference the sample code for the same in the below blog:
https://www.forcetalks.com/salesforce-topic/how-to-refresh-component-after-button-click-for-viewing-updated-values-after-refreshing-page-in-salesforce-lightning/
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
All Answers
Greetings!
You can create the lightning component to refresh the page on button click using force:refreshView which just refresh the page without making any changes.
Reference the sample code for the same in the below blog:
https://www.forcetalks.com/salesforce-topic/how-to-refresh-component-after-button-click-for-viewing-updated-values-after-refreshing-page-in-salesforce-lightning/
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
Please create this class in your org: Now add the below VF page: Now change the content source of your button to this new VF page. It will simply refresh the page and return to the same account.
Let me know if you face any issue with this.
Thanks,
Abhishek Bansal.
Gmail: abhibansal2790@gmail.com
Skype: abhishek.bansal2790
Phone: +917357512102
Thank you, Abhishek. Getting this error when I try to save the class:
Error: Compile Error: Incompatible types since an instance of Id is never an instance of Account at line 4 column 21
Please find the updated class below:
Let me know if you still face any issues.
Thanks,
Abhishek Bansal.
Please close the question if this works for you.
Thanks,
Abhishek Bansal.