Newer Version Available
DescribeLayoutResult
| Name | Type | Description |
|---|---|---|
| feedView | DescribeLayoutFeedView[] | Feed view related layout data for a feed-based layout. This field is null for page layouts that are not feed-based. |
| layouts | DescribeLayout[] | Layout(s) associated with the specified sObjectType. In general, there is a one-to-one correspondence between layouts and objects. However, in some cases, an object will have multiple layouts in the context of a given user profile. |
| recordTypeMappings | RecordTypeMapping[] | Record type mapping(s) available for the user. The objects on a user profile can have multiple record types. All record types are returned, not just those available to the calling user. This allows the client application to display a layout appropriate for a given user profile. For example, suppose User A owns a record, and this record has record type X set. If User B tries to view this record, then the client application can display the record using the layout associated with this record type for User B’s profile (even if the record type is not available for the user). |
| recordTypeSelectorRequired | boolean | If true, a record type selector page is required; if false, use the default record type. |
DescribeLayout
Represents a specific layout for the specified sObjectType. Each DescribeLayout is referenced by its unique layout ID and consists of two types of views (represented in this object as arrays of DescribeLayoutSection):
- Detail view—Read-only display of the object. In a detail layout, certain pieces of information (such as address details) might be aggregated into a single DescribeLayoutItem.
- Edit view—Editable display of the object. In an edit layout, individual pieces of information (such as an address) will be broken up into separate fields.
An individual DescribeLayout consists of these fields:
| Name | Type | Description |
|---|---|---|
| buttonLayoutSection | DescribeLayoutButtonSection | Standard and custom button sections associated with the specified layout. |
| detailLayoutSections | DescribeLayoutSection[] | Layout section(s) for the detail view. |
| editLayoutSections | DescribeLayoutSection[] | Layout section(s) for the edit view. |
| highlightsPanelLayoutSection | DescribeLayoutSection[] | Layout section(s) for the highlights panel view. |
| multirowEditLayoutSections | DescribeLayoutSection[] | Layout section(s) for the multiline layout view. This field is available in API version 35.0 and later. |
| id | ID | Unique ID of this layout. For information on IDs, see ID Field Type. |
| quickActionList | DescribeQuickActionListResult | List of actions associated with the specified layout. This field is available in API version 28.0 and later. |
| relatedContent | RelatedContent | Mobile Cards section associated with the specified layout. This field is available in API version 29.0 and later. |
| relatedLists | RelatedList[] | Related list(s) associated with the specified layout. |
| saveOptions | DescribeLayoutSaveOption[] | List of save options for the layout. |
DescribeLayoutButtonSection
Represents one of two sections of the layout containing either standard or custom buttons.
| Name | Type | Description |
|---|---|---|
| detailButtons | DescribeLayoutButton[] | Standard or custom button(s) associated with the specified button section. |
Represents a single standard button, custom button, or custom link in a DescribeLayout.
| Name | Type | Description |
|---|---|---|
| behavior | WebLinkWindowType | What the button or link does when clicked, such as execute JavaScript or open
its content source in a new window, for example. This field is available in API version 31.0 and later. |
| colors | DescribeColor[] |
Array of color information for icons
associated with this button or link. Each color is associated with a
theme. This field is available in API version 32.0 and later. |
| content | string | The API name of the Visualforce page or s-control
being delivered. This field is available in API version 31.0 and later. |
| contentSource | WebLinkType | The content source of the custom button or link. The
contentSource for a standard button which hasn’t been
overridden is null. This field is available in API version 31.0 and later. |
| custom | boolean | Required. Indicates whether this is a custom button or link (true) or not (false). |
| encoding | string | Type of encoding assigned to the URL called by the button or link. Valid values
are:
|
| height | int | The height (in pixels) when a button or link’s behavior field value is set to newWindow, sidebar, or noSidebar. This field is available in API version 31.0 and later. |
| icons | DescribeIcon[] | Array of icons for this button or link. Each icon is associated with a theme. This field is available in API version 29.0 and later. |
| label | string | Label for the button or link displayed in the Salesforce user interface. |
| menubar | boolean | Indicates whether the menu bar displays (true) or not (false) when a button or
link’s behavior field value is set to newWindow. This field is available in API version 31.0 and later. |
| name | string | API name of the button or link. |
| overridden | boolean | Required. Indicates whether a standard button has been overridden (true) or not (false). This field is available in API version 31.0 and later. |
| resizeable | boolean | Indicates whether the new window is resizeable (true) or not (false) when a button or
link’s behavior field value is set to newWindow. This field is available in API version 31.0 and later. |
| scrollbars | boolean | Indicates whether scrollbars display (true)
or not (false) when a button or link’s
behavior field value is set to newWindow. This field is available in API version 31.0 and later. |
| showsLocation | boolean | Indicates whether the address bar displays (true) or not (false) when a button or
link’s behavior field value is set to newWindow. This field is available in API version 31.0 and later. |
| showsStatus | boolean | Indicates whether the status bar displays (true) or not (false) when a button or
link’s behavior field value is set to newWindow. This field is available in API version 31.0 and later. |
| toolbar | boolean | Indicates whether the toolbars display (true) or not (false) when a button or
link’s behavior field value is set to newWindow. This field is available in API version 31.0 and later. |
| url | string | The URL called by the button or link. This field is null for standard buttons in a related list. This field is available in API version 31.0 and later. |
| width | int | The width (in pixels) when a button or link’s behavior field value is set to newWindow. This field is available in API version 31.0 and later. |
| windowPosition | WebLinkPosition | Indicates the window position when a button or link’s behavior field value is set to newWindow. This field is available in API version 31.0 and later. |
DescribeLayoutComponent
Represents the smallest unit in a layout—a field or a separator. To reference a field for display, a client application uses the following notation to reference a field in the describeSObjects() call: LayoutComponent.fieldName.
In API version 31.0 and later, DescribeLayoutComponent is extended with FieldLayoutComponent if both the LayoutComponentType value is Field, and the field being described is either the compound field Address or the compound field Person Name.
| Name | Type | Description |
|---|---|---|
| displayLines | int | The number of vertical lines displayed for a field in the edit view. Applies to textarea and multi-select picklist fields. |
| tabOrder | int | Indicates the tab order for the item in the row. |
| type | LayoutComponentType | The LayoutComponentType for this LayoutComponent. |
| value | string | Value of this LayoutComponent. The name of the field if the LayoutComponentType value is Field. The API name of the canvas app if the LayoutComponentType value is Canvas. |
DescribeLayoutItem
Represents an individual item in a DescribeLayoutRow. A DescribeLayoutItem consists of a set of components (DescribeLayoutComponent), each of which is either a field or a separator. For most fields on a layout, there is only one component per layout item. However, in a display-only view, the DescribeLayoutItem might be a composite of the individual fields (for example, an address can consist of street, city, state, country, and postal code data). On the corresponding edit view, each component of the address field would be split up into separate DescribeLayoutItems.
| Name | Type | Description |
|---|---|---|
| editable | boolean | Indicates whether this DescribeLayoutItem can be edited (true) or not (false). This field is available in API version 30.0 and below. It was replaced by the editableForNew and editableForUpdate fields in API version 31.0. |
| editableForNew | boolean |
Indicates whether a new DescribeLayoutItem can be
edited when creating a new record (true) or not
(false). This field is available in API version 31.0 and later. |
| editableForUpdate | boolean |
Indicates whether an existing
DescribeLayoutItem can be edited when editing a record (true) or not (false). This field is available in API version 31.0 and later. |
| label | string | Label text for this DescribeLayoutItem. |
| layoutComponents | DescribeLayoutComponent[] | DescribeLayoutComponent for this DescribeLayoutItem. |
| placeholder | boolean | Indicates whether this DescribeLayoutItem is a placeholder (true) or not (false). If true, then this DescribeLayoutItem is blank. |
| required | boolean | Indicates whether this DescribeLayoutItem is required (true) or not (false). This is useful to know if, for example, you wanted to render required fields in a contrasting color (such as red). |
DescribeLayoutRow
Represents a row in a DescribeLayoutSection. A DescribeLayoutRow consists of one or more DescribeLayoutItem objects. For each DescribeLayoutRow, a DescribeLayoutItem refers either to a specific field or to an “empty” DescribeLayoutItem (a DescribeLayoutItem that contains no DescribeLayoutComponent objects). An empty DescribeLayoutItem can be returned when a given DescribeLayoutRow is sparse (for example, containing more fields on the right column than on the left column). Where there are gaps in the layout, an empty DescribeLayoutItem is returned as a placeholder.
| Name | Type | Description |
|---|---|---|
| layoutItems | DescribeLayoutItem[] | Refers to either a specific field or to an empty LayoutItem (a LayoutItem that contains no DescribeLayoutComponent objects). |
| numItems | int | Number of layoutItems. This information is redundant but, due to a bug in a popular SOAP toolkit, was required to avoid serialization problems. |
DescribeLayoutSection
Represents a section of a DescribeLayout and consists of one or more columns and one or more rows (an array of DescribeLayoutRow).
| Name | Type | Description |
|---|---|---|
| columns | int | Number of columns in this DescribeLayoutSection. |
| heading | string | Heading text (label) for this DescribeLayoutSection. |
| layoutRows | DescribeLayoutRow[] | Array of one or more DescribeLayoutRow objects. |
| parentLayoutId | ID |
The ID of the layout upon which this DescribeLayoutSection resides. This field is available in API version 35.0 and later. |
| rows | int | Number of rows in this DescribeLayoutSection. |
| tabOrder | string | Indicates the tab order for the fields in the section in the edit view. Valid
values are:
This field is available in API version 31.0 and later. |
| useCollapsibleSection | boolean | Indicates whether this DescribeLayoutSection is a collapsible section, also known as a “twistie” (true), or not (false). |
| useHeading | boolean | Indicates whether to display the heading (true) or not (false). |
DescribeQuickActionListResult
Represents a list of actions assigned to the page layout. Available in API version 28.0 and later.
| Name | Type | Description |
|---|---|---|
| quickActionListItems | DescribeQuickActionListItemResult[] | Array of zero or more QuickActionListItemResult objects. |
DescribeQuickActionListItemResult
Represents a QuickAction assigned to the actions list for a page layout. Available in API version 28.0 and later.
| Name | Type | Description |
|---|---|---|
| colors | DescribeColor[] | Array of color information. Each color is associated with a theme. This field is available in API version 29.0 and later. |
| iconUrl | string | The URL of the icon associated with the action. This icon URL corresponds to the 32x32 icon used for the current Salesforce theme, introduced in Spring ‘10. |
| icons | DescribeIcon[] | Array of icons for this action. Each icon is associated with a theme. This field is available in API version 29.0 and later. |
| label | string | The label of the action. |
| miniIconUrl | string | The URL of the mini icon associated with the action. This icon URL corresponds to the 16x16 icon used for the current Salesforce theme, introduced in Spring ‘10. |
| quickActionName | string | The API name of the action. |
| targetSobjectType | string | The API name of the action’s target object. |
| type | string | The QuickActionType of the action. Valid values are:
|
CustomLinkComponent
When the LayoutComponentType value is CustomLink, this type contains information about a single custom link on the page layout.
| Name | Type | Description |
|---|---|---|
| customLink | DescribeLayoutButton | A single LayoutComponent object of type CustomLink. |
FieldLayoutComponent
Extends the information returned by DescribeLayoutComponent. When the LayoutComponentType value is Field, and the field being described is an Address or Person Name field, FieldLayoutComponent includes information about the field’s components.
Available in API version 31.0 and later.
| Name | Type | Description |
|---|---|---|
| components | DescribeLayoutComponent[] | Array of zero or more LayoutComponent objects of type Field. |
| fieldType | FieldType | The field type. |
Sample Code for Usage of FieldLayoutComponent
1DescribeLayoutComponent layoutComponent = layoutComponents[n];
2 // Look for a component representing the BillingAddress field
3 if (layoutComponent.getType() == LayoutComponentType.Field.toString() &&
4 layoutComponent.getValue().equals("BillingAddress") {
5 // Cast this component as a FieldLayoutComponent
6 DescribeLayoutComponent.FieldLayoutComponent addressFieldComponent =
7(FieldLayoutComponent)layoutComponent;
8 // At this point you can access addressFieldComponent
9FieldLayoutComponent-specific methods such as getComponents() or
10getFieldType()
11 }LayoutComponentType
- AnalyticsCloud—An Analytics dashboard on the page layout. Available in API version 34.0 and later.
- Canvas—A canvas component on the page layout. This layout component type is available in API version 31.0 and later.
- CustomLink—A custom link on the page layout.
- EmptySpace—A blank space on the page layout.
- ExpandedLookup—An Expanded Lookup component in the Mobile Cards section of the page layout.
- Field—Field name. A mapping to the name field on the describeSObjectResult.
- ReportChart—A report chart on the page layout.
- SControl—Reserved for future use.
- Separator—Separator character, such as a semicolon (:) or slash (/).
- VisualforcePage—A Visualforce component on the page layout.
PicklistForRecordType
Represents a single record type picklist in a RecordTypeMapping. The picklistName matches up with the name attribute of each field in the fields array in describeSObjectResult. The picklistValues are the set of acceptable values for the recordType.
| Name | Type | Description |
|---|---|---|
| picklistName | string | Name of the picklist. |
| picklistValues | PicklistEntry[] | Set of picklist values associated with the recordTypeIds in the RecordTypeMapping. Note: If you retrieve picklistValues, the validFor value is null. If you need the validFor value, get it from the PicklistEntry object obtained from the Field object associated with the DescribeSObjectResult. |
RecordTypeMapping
Represents a single record type mapping in the recordTypeMappings field in a DescribeLayoutResult object. This object is a map of valid recordTypeIds to layoutId. For displaying a detail view, a client application uses this mapping to determine which layout is associated with the record type on the record. For displaying an edit view, a client application uses this mapping to determine which layout to use (and possibly to allow the user to choose between multiple record types); it will also determine the set of available picklist values.
| Name | Type | Description |
|---|---|---|
| available | boolean | Indicates whether this record type is available (true) or not (false). Availability is used to display a list of available record types to the user when they are creating a new record. |
| defaultRecordTypeMapping | boolean | Indicates whether this is the default record type mapping (true) or not (false). |
| layoutId | ID | ID of the layout associated with this record type. |
| name | string | Name of this record type. |
| picklistsForRecordType | PicklistForRecordType[] | Record type picklist(s) mapped to the recordTypeIds. |
| recordTypeId | ID | ID of this record type. |
DescribeLayoutSaveOption
Represents the save options for the layout. Save options define behavior that occurs when objects are created or modified using the given layout. For example, for Cases and Leads, a “UseDefaultAssignmentRule” save option is exposed to control whether assignment rules are applied when Cases or Leads are created or edited.
| Name | Type | Description |
|---|---|---|
| defaultValue | boolean |
Default value for the save option. Controls whether the save option defaults to enabled or not in the Salesforce user interface. For example, for the “UseDefaultAssignmentRule” save option, if defaultValue is true, then by default the system triggers the default assignment rules when an Account, Case, or Lead is created or edited. If false, then the default assignment rules aren’t applied when an Account, Case, or Lead is created or edited, unless the user enables the save option in the Salesforce user interface. |
| isDisplayed | boolean | If true, then the save option is displayed in the layout. If false, then the save option isn’t displayed in the layout. |
| label | string | Label for the save option that is displayed in the Salesforce user interface. |
| name | string | API name for the save option. |
| restHeaderName | string | The corresponding REST API header for the save option. |
| soapHeaderName | string | The corresponding SOAP API header for the save option. |
WebLinkPosition
- fullScreen—The new window opens in a full screen. If this option is selected, any width or height parameters set for the new window are ignored.
- none—No window position preference is set.
- topLeft—The new window opens, positioned at the top left of the screen.
WebLinkWindowType
- newWindow—The custom button’s content opens in a new browser window.
- noSidebar—The custom button’s content displays in the existing browser window without a sidebar.
- onClickJavaScript—Valid only when the DescribeLayoutButton’s contentSource field value is javascript. Clicking the button or link executes JavaScript.
- replace—The custom button’s content displays in the existing browser window without a sidebar or header.
- sidebar—The custom button’s content displays in the existing browser window with a sidebar.