Newer Version Available

This content describes an older version of this product. View Latest

describeSObjects()

An array-based version of describeSObject(); describes metadata (field list and object properties) for the specified object or array of objects.

Use this call instead of describeSObject().

Note

Syntax

Usage

Use describeSObjects() to obtain metadata for a given object or array of objects. You can first call describeGlobal() to retrieve a list of all objects for your organization, then iterate through the list and use describeSObjects() to obtain metadata about individual objects. The describeSObjects() call is limited to a maximum of 100 objects returned.

Your client application must be logged in with sufficient access rights to retrieve metadata about your organization’s data. For more information, see Factors that Affect Data Access.

In organizations where person accounts are enabled, this call shows Accounts as not createable if the profile does not have access to any business account record types.

Sample Code—Java

This sample calls describeSObjects() to perform describes on account, contact, and lead. It iterates through the sObject describe results, gets the properties and fields for each sObject in the result, and writes them to the console. For picklist fields, it writes the picklist values. For reference fields, it writes the referenced object names.

Sample Code—C#

This sample calls describeSObjects() to perform describes on account, contact, and lead. It iterates through the sObject describe results, gets the properties and fields for each sObject in the result, and writes them to the console. For picklist fields, it writes the picklist values. For reference fields, it writes the referenced object names.

Arguments

The describeSObjects() call takes in an array of sObjects.

Name Type Description
sObjectType string Object. The specified value must be a valid object for your organization. For a complete list of objects, see Standard Objects.