In Salesforce, custom list view buttons are visible to all users by default and cannot be hidden from specific profiles using declarative configuration alone. To restrict visibility of a custom list view button to certain profiles, a development-based workaround is required. This article covers two approaches: using a Visualforce page to replicate the list view, or adding Apex logic to the button's onclick handler.
The following two workarounds allow you to control which profiles can use a custom list view button. Choose the approach that best fits your org's requirements and development resources.
Create a Visualforce page that replicates the list view layout and replaces the list view page for affected users. Within the page, use Apex to evaluate the running user's profile and conditionally display or hide the button using the apex:commandButton rendered attribute.
Note: This approach requires re-querying and re-rendering all list view data and is more complex to implement.
Add an Apex-based JavaScript snippet to the button's OnClick property. The snippet checks the running user's Profile ID or Profile Name and either executes the button's intended action or displays a permission-denied message. The button remains visible to all profiles, but only authorized profiles can successfully use its functionality.
Note: In this approach the button is always shown to all profiles but can only be used by authorized profiles.
If you would like to see native profile-based button visibility implemented as a platform feature, you may vote for the related Idea on the Salesforce Trailblazer Community.
000384946

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.