Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Can we control the VisualForce Tab Visibility using custom settings?

Actually my use case is like, i have to create a VisualForce tab and need to control its visibility using custom setting so that i can decide which user/proifle should have permission to see the tab.

Or if there is any other option to assign tab visibility to certain users and profiles.

Thanks in advance

share|improve this question
add comment

2 Answers 2

I belive that you can't do that in Custom Setting.

    Salesforce.com allows each user to customize his or her display, including control of which tabs are turned on and which related lists are displayed on each detail page.


For Professional Edition, display customization is a user-specific setting. There is no way for an administrator to turn tabs on or off for all users at once.

If you are a System Administrator, you can forward these instructions to your users to have them turn Tabs on or off:

           1. Log into Salesforce.

           2. Click on:

            Setup | Personal Setup | My Personal Information | Change My 

            Display |Customize My Tabs.

           3. Select the desired tab from the selected tabs or available tabs list.

           4. Click remove or add to move the tab to the available tabs list or

            selected tabs  list.

           5. Click "Save".


For Enterprise Edition, custom profiles can control which tabs appear. To customize an existing custom profile and hide or turn off tabs, follow these steps.
            1. Click on:

             Setup | Administration Setup | Manage Users | Profiles.

            2. Click the edit link to the left of the custom profile.

            3. In the tab settings area, select the appropriate value from the picklist.

The following choices affect tab visibility.

             1. Default On: Show the tab by default for users with this profile.

              Individual users can override this setting for their login. 


             2. Default Off: Hide the tab by default for users with this profile.

              Individual users can override this setting.


             3. Tab Hidden: Hide the tab and do not allow individual users to

              override this setting in their personal customization.

But you can create VF page where you could manage those permission sets. How about that? After you create those permission set you can manage assign in this page based on :

PermissionSetAssignment object

Or even you can create hierarchical custom setting with Boolean value for all users and create method that will assign this permission set based on custom setting.

share|improve this answer
add comment

You can simply control Tab visibility for different profiles. Just go the the profile and choose to make the tab as hidden, for those profiles which you dont want to have access to it.

EDIT

For user specific access to the Tab for users of the same profile, use permission sets. Dont give access to the tab in the base profile, and then use a permission set to give access to only those users who need it.

share|improve this answer
    
I know that. I need to control visibility for a particular user as well –  Pramod Kumar Feb 3 at 7:33
    
Can you try controlling the tab visibility through permission sets? For your profile dont give access to any users for that VF tab, and create a Permission set to extend permission to only those that need access. –  AslamK Feb 3 at 7:46
    
Permission set might be an option but i would like to do it using Custom setting where admin can select user or profile name and their permission like Read/edit and all is set –  Pramod Kumar Feb 3 at 7:55
    
You can create VF page where you could manage those permission sets. How about that? –  Artur Kępczyński Feb 3 at 8:08
1  
@PramodKumar There does not seem to be a way to use Custom setting for that. As far as I can think of, tab visibility cant be controlled programatically in your code (unless maybe its some JavaScript hack). Permission set seems to be the best bet. –  AslamK Feb 3 at 8:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.