1

After installing a managed package I want to modify the SetupEntityAccess records for a PermissionSet to grant access to an App that was installed as part of the package. Ideally this would have been done as part of the package definition, but that doesn't appear to be possible:

Note:
Permission sets include assigned apps and tab settings, but these settings can’t be packaged as permission set components.
From About Permission Sets and Profile Settings in Packages

The PermissionSet (0PS) that was installed as part of the managed package can be found with SOQL using the PermissionSet.NamespacePrefix field.

How can I find the TabSet (App) Id in Apex?

It will have an Id with the key prefix 02u.

I can find the metadata for the TabSet by using Schema.describeTabs() and searching the results until getNamespace() returns the expected value. However, the Schema.DescribeTabSetResult doesn't expose the ID of the TabSet.

2

It looks like I can use the new AppMenuItem to find the TabSet Id by Namespace:

select Id, NamespacePrefix 
from AppMenuItem 
where NamespacePrefix = 'foobar' and Type = 'TabSet'

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.