describeTabs()

The describeTabs call returns information about the standard and custom apps available to the logged-in user. An app is a group of tabs that works as a unit to provide application functionality. For example, two of the standard Salesforce.com apps are “Sales” and “Service and Support.”

Syntax

describeTabSetResult []  = binding.describeTabs();

Usage

Use the describeTabs() call to obtain information about the standard and custom apps to which the logged-in user has access. The describeTabs call returns the minimum required metadata that can be used to render apps in another user interface. Typically this call is used by partner applications to render Salesforce.com data in another user interface.

In the Salesforce.com user interface, users have access to standard apps (and may also have access to custom apps) as listed in the Force.com app menu at the top of the page. Selecting an app name in the menu allows the user to switch between the listed apps at any time.

For each app, the call returns the app name, the URL of the logo, whether or not it is the currently selected application for the user, and details about the tabs included in that app.

For each tab, the call returns the tab name, the primary sObject that is displayed on the tab, whether it is a custom tab, and the URL for viewing that tab. Note that the “All Tabs” tab is never included in the list of tabs.

Sample Code—Java

private void describeTabSet ()
{
  try {
    DescribeTabSetResult[] dtsrs = binding.describeTabs();
    System.out.println("There are " + dtsrs.length + 
                       " tabsets defined.");
    for (int i=0;i<dtsrs.length;i++) {
      System.out.println("Tabset " + (i+1) + ":");
      DescribeTabSetResult dtsr = dtsrs[i];
      String tabSetLabel = dtsr.getLabel();
      String logoUrl = dtsr.getLogoUrl();
      boolean isSelected = dtsr.isSelected();
      DescribeTab[] tabs = dtsr.getTabs();
      System.out.println("Label is " + tabSetLabel + " logo url is " + logoUrl +
          ", there are " + tabs.length + " tabs defined in this set." +
          " This tab is selected: " + isSelected);
      for (int j=0;j<tabs.length;j++) {
        DescribeTab tab = tabs[j];
        String tabLabel = tab.getLabel();
        String objectName = tab.getSobjectName();
        String tabUrl = tab.getUrl();
        System.out.println("\tTab " + j + 1 + ": \n\t\tLabel = " +
            tabLabel + "\n\t\tObject details on tab: " + objectName + "\n\t\t" +
           "Url to tab: " + tabUrl);
      }
    }
  } catch (Exception ex) {
    System.out.println("\nFailed to describe tabs, error message was: \n" + 
                       ex.getMessage());
  }
  }

Sample Code—C#

private void describeTabsSample()
{
    sforce.DescribeTabSetResult[] dtsrs = binding.describeTabs();
    Console.WriteLine("There are " + dtsrs.Length.ToString() + " tabsets defined.");
    for (int i=0;i<dtsrs.Length;i++) 
    {
        Console.WriteLine("Tabset " + (i + 1).ToString() + ":");
        sforce.DescribeTabSetResult dtsr = dtsrs[i];
        String tabSetLabel = dtsr.label;
        String logoUrl = dtsr.logoUrl;
        bool isSelected = dtsr.selected;
        DescribeTab[] tabs = dtsr.tabs;
        Console.WriteLine("Label is " + tabSetLabel + " logo url is " + logoUrl + ", 
                        there are " + tabs.Length.ToString() + " tabs defined in this set.");
       for (int j=0;j<tabs.Length;j++) 
       {
           sforce.DescribeTab tab = tabs[j];
           String tabLabel = tab.label;
           String objectName = tab.sobjectName;
           String tabUrl = tab.url;
           Console.WriteLine("\tTab " + (j + 1).ToString() + ": \n\t\tLabel = " + 
                           tabLabel + "\n\t\tObject details on tab: " + objectName +
             "\n\t\t" + "Url to tab: " + tabUrl);
        }
    }
}

Arguments

None.

Response

describeTabSetResult, describeTab

© Copyright 2000-2010 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.