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
Guru Vemuru 1Guru Vemuru 1 

How to hide list button for profiles?

Hi every one,
I have a list button(visual force). Now i want to hide this list button for one profile.
How can i do it.
NagendraNagendra (Salesforce Developers) 
Hi Guru,

Workarounds to hide custom list view button from profiles:

1. Develop a VisualForce page to replicate the list view page and the button and add apex code to display/hide the command button based on the running profile. This solution requires re-querying all the list views.

2. Add an apex code in the "onclick" of the button which will either allow button functionality or display error message based on the profile clicking it. In this case the button will always be shown to all profiles but could only be used by authorized profiles.

If this is a feature that you'd like to see implemented, make sure you go vote for the Idea
For more information please check with below link

Hope this helps.

Please mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.

Thanks,
Nagendra 
Maria AlexanderMaria Alexander
Hi Guru Vemuru 1,

In Profile its self we can Restics the  Field It won the show in visual force page. 
this answer is satisfaction select solved 
thank you