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
GÜNES AdminGÜNES Admin 

How to show/hide a lightning button based on a picklist value?

Dear all,

This is custom object development on Platform.
At the moment, there are two lightning buttons. One is called "Cancel".

The goal is to hide the Cancel button, if the picklist value of the field "Stage" is set to "Canceled".

Alternatively, a more elegant solution would be to change the button's style to "disabled" so it is grayed out and not clickable.

Both solutions would do. Can you please provide guidance on how to achieve this? Thank you!

User-added image
 
SwethaSwetha (Salesforce Developers) 
HI GÜNES ,
It is not clear on what context your development is based on- aura/LWC/VF.

Recommend reviewing related posts: https://salesforce.stackexchange.com/questions/122803/need-to-disable-button-for-particular-status-picklist-value
https://developer.salesforce.com/forums/?id=9062I000000Qv1oQAC
https://salesforce.stackexchange.com/questions/264488/lightning-component-hiding-button-depending-on-a-value-of-a-field

If this information helps, please mark the answer as best. Thank you