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
Abhishek AS 3Abhishek AS 3 

How to hide custom update button for certain users?

I have a custom mass update button for mass updating fields of records. But I want to hide it from certain users. How can I do it?
SwethaSwetha (Salesforce Developers) 
HI Abhishek,
Check out https://help.salesforce.com/s/articleView?id=000333302&type=1 which suggests using Dynamic Actions on Record Pages

Alternately, create a formula field and take advantage of the HYPERLINK function (add a image to the hyperlink to look like button) to conditionally display the link. For example, the following formula will display the Google hyperlink to "System Administrators" users only:

IF(CONTAINS($Profile.Name,"System Administrator"),HYPERLINK("http://www.google.com/"​,"Button name")," ")

No other user will be able to see the "button" (Image).

Related: https://developer.salesforce.com/forums/?id=9062I000000DID7QAO

If this information helps, please mark the answer as best. Thank you
Abhishek AS 3Abhishek AS 3
I already created a quick action for mass updating records and put it in search layout. I want that to be hidden for some users. There is no standard functionality to do it in salesforce Get Outlook for Android
ravi soniravi soni
Hi,
you can achieve it by permission set. who you want to show the button assign a permission set and give permission to see the button and from in profile remove permission to view the button.
make sure permission should be remove from all the profiles and who you want to show the button assign the permission set.

I think it will work.
don't forget to mark it as best answer if it helps you.
Thank you
 
Abhishek AS 3Abhishek AS 3
I want to hide button from list view page. Is there a way to create a vf page for replicating listview page with a custom button for mass updating records and hide that button for certain users using code. Kindly share code if u got it Get Outlook for Android