MenuItem

Represents a menu item.

Version 

Introduced in API version 32.0.

Supported SOAP API Calls 

describeSObjects(), query(), update()

Supported REST API Methods 

PATCH, Query

Fields 

Active 

  • Type: boolean

  • Required: No

  • Properties: Defaulted on create, Filter, Group, Sort, Update

  • Description: Indicates whether the item in the menu is active (true) or not (false).

  • Default value: false

AppId 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Sort

  • Description: The ID of the app that this menu item is associated with. Can be an enum (such as Feed or People) or an alphanumeric ID.

Use AppId as the unique ID for the menu item, not Id.

Color 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The color of the menu item that appears in the user interface. This field is described in Web color RGB format, such as 00FF00.

IconUrl 

  • Type: url
  • Required: No
  • Properties: Filter, Group, Nillable, Sort

Label 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The menu item label that appears in the user interface.

MenuType 

  • Type: picklist

  • Required: No

  • Properties: Filter, Group, Nillable, Restricted picklist, Sort

  • Description: The type of menu that this menu item belongs to.

This field is required for query().

  • Possible values:

    • AppSwitcher — AppSwitcher

    • Salesforce1 — Salesforce1

    • NetworkTabs — NetworkTabs

SortOrder 

  • Type: int

  • Required: No

  • Properties: Filter, Group, Nillable, Sort, Update

  • Description: The SortOrder value determines the order in which a menu item is displayed in the user interface. This field must be an ordinal number greater than 0, and must be unique in the list. Inactive menu items have a value of -1.

Theme 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The associated theme, which must be one of the following values.

  • theme2: the Salesforce theme that was used prior to Spring ’10

  • theme3: the Salesforce theme that was introduced in Spring ’10

  • theme4: the theme that was introduced in Winter ’14 for the mobile touchscreen version of Salesforce

  • custom: the theme that’s associated with a custom icon

This field is required for query() for Color and IconURL.

Usage 

MenuItem can be queried and manipulated to change how menu items appear in Salesforce. The following example modifies the Salesforce mobile app navigation menu.

1String query = "SELECT AppId, Label, Active, SortOrder FROM MenuItem "
2+
3     "WHERE MenuType = 'Salesforce'";
4SObject[] records = sforce.query(query).getRecords();
5
6//Activate all menu items
7for (int i = 0; i < records.length; i++) {
8   MenuItem item = (MenuItem)records[i];
9   item.setOrder(i + 1);
10   item.setActive(true);
11}
12
13sforce.update(records);

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!