The Schema.describeTabs method returns a list of Schema.DescribeTabSetResult objects that describe standard and custom apps.
The methods in the Schema.DescribeTabSetResult class can be called using their property counterparts. For each method starting with get, you can omit the get prefix and the ending parentheses () to call the property counterpart. For example, tabSetResultObj.label is equivalent to tabSetResultObj.getLabel(). Similarly, for each method starting with is, omit the is prefix and the ending parentheses (). For example, tabSetResultObj.isSelected is equivalent to tabSetResultObj.selected.
This example shows how to call the Schema.describeTabs method to get describe information for all available apps. This example iterates through each describe result and gets more metadata information for the Sales app.
// App we're interested to get more info about String appName = 'Sales'; // Get tab set describes for each app List<Schema.DescribeTabSetResult> tabSetDesc = Schema.describeTabs(); // Iterate through each tab set describe for each app and display the info for(Schema.DescribeTabSetResult tsr : tabSetDesc) { // Get more information for the Sales app if (tsr.getLabel() == appName) { // Find out if the app is selected if (tsr.isSelected()) { System.debug('The ' + appName + ' app is selected. '); } // Get the app's Logo URL and namespace String logo = tsr.getLogoUrl(); System.debug('Logo URL: ' + logo); String ns = tsr.getNamespace(); if (ns == '') { System.debug('The ' + appName + ' app has no namespace defined.'); } else { System.debug('Namespace: ' + ns); } // Get the number of tabs System.debug('The ' + appName + ' app has ' + tsr.getTabs().size() + ' tabs.'); } } // Example debug statement output // DEBUG|The Sales app is selected. // DEBUG|Logo URL: https://na1.salesforce.com/img/seasonLogos/2014_winter_aloha.png // DEBUG|The Sales app has no namespace defined. // DEBUG|The Sales app has 14 tabs.
The following are methods for DescribeTabSetResult. All are instance methods.
public String getLabel()
Type: String
The display label changes when tabs are renamed in the Salesforce user interface. See the Salesforce online help for more information.
public String getLogoUrl()
Type: String
public String getNamespace()
Type: String
This namespace prefix corresponds to the namespace prefix of the Developer Edition organization that was enabled to allow publishing a managed package. This method applies to a custom app containing a set of tabs and installed as part of a managed package.
public List<Schema.DescribeTabResult> getTabs()
Type: List<Schema.DescribeTabResult>
public Boolean isSelected()
Type: Boolean