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
anusfdc123anusfdc123 

How to hide a section in a standard pagelayout based on the user

Hello,
Iam looking a a way to hide a particular section in the standard layout of Account object. What is the better way to do this? If you have any thoughts, please let me know.
JP.
Sonam_SFDCSonam_SFDC
You can create a pagelayout specific to this user profile and assign that to this user so when he opens the record - the sections relevant to him re the ones he/she sees: http://help.salesforce.com/HTViewHelpDoc?id=customize_layoutassign.htm&language=en_US
anusfdc123anusfdc123
Thanks Sonam. Iam aware of that. I don't want to create a seperate profile for these users just to hide a section in one Layout. Iam looking for a dynamic way of hiding the section based on the user who logged in.
Sonam_SFDCSonam_SFDC
In that case you would have to go with overrriding the current page with the visualforce page so that you can control the UI based on the user viewing it.

Check the following link which talks about a similar issue - it has sample code as well:
http://stackoverflow.com/questions/10993851/how-to-hide-sections-of-page-layout-based-off-owner
anusfdc123anusfdc123
Thanks Sonam. Yeah, I did looked at that post before, but in my case I have a visual force component embeded in a section in a standard page layout and I want to hide that section based on the User. Field sets wont work in this case.  Anyways thanks for your help.
Venkata Shiva Koushik RachapudiVenkata Shiva Koushik Rachapudi
Hello @anusfdc123.
i am facing this same problem and would want to know how you had this fix. i have a visualforce component that needs to be visible to the pagelayout but not all users. permission set is throwing a insufficinet privileges error messsage. and i dont want that to be shown to the users