4

I have a VisualForce tab that is included in my managed package. I have also created a Permission Set for the VisualForce tab that makes the tab visible and available. When I created the tab, the tab visibility was set to "Default On" for all profiles. I also included the tab on all custom apps in my org and checked "Append tab to users' existing personal customizations". In the dev org that this tab was created in, the tab is visible for all custom apps and was appended to the user's list of selected apps.

The permission set and the VisualForce tab (and the VisualForce page that the tab displays) are all included in the managed package. When the package is installed on a test org, the tab is available in the "All Tabs" section to admins and users with the associated permission set. They can also select "Customize My Tabs" and add the tab to their list of selected tabs for whatever app they want.

I want the managed package to "Append tab to users' existing personal customizations" when it is installed. Is that possible? Do I need to create a post-install script for my package? Is there a way that an org admin could easily do this? if so how? Ideally this would be handled by the package installation or by some apex run after installation. I am also interested in hearing about other solutions and learning about tab management in general.

thanks in advance for your help.

  • If your managed package installed an App then the new Tab could be part of the tab set when that App is selected. Beyond that, should a custom tab from your managed package really be added to the tab sets for all other apps? – Daniel Ballinger Mar 23 '14 at 1:40
  • Are you saying that doing this goes against the grain of how SF (and user customizations) was designed to work? I thought it would be an accessible way for non-technical users to see the new tab. But, I guess if they don't know how to add the tab to their selected tab list, then they probably don't know how to remove it either. – edgartheunready Mar 24 '14 at 15:55
1

As per my comment. You could use an App as part of the managed package that includes the new Tab. Then, when users select your App they will get the tab.

Personally, I don't think installing a managed package should reach out and add a tab to all the installed Apps.

That said, on install of the managed package you could for force all the users into your permission set that makes the tab visible.

List<PermissionSetAssignment> psas = new List<PermissionSetAssignment>();
for(User u : someUserList) {
    PermissionSetAssignment p = new permissionsetassignment();
    p.assigneeId = u.Id;
    p.permissionsetId = permissionSetId; 
    psas.add(p);
}
insert psas;

Alternatively, edit the profiles and use the Overwrite users' personal tab customizations in the Tab Settings.

Override users' personal tab customizations

  • By the by, "overwrite users' personal tab customizations" is a one-time event. It doesn't persist in a package, nor does it cause the tab to automatically appear on installation. That's up to an administrator to decide post-install. – sfdcfox Jul 23 '14 at 4:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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