Newer Version Available
listMetadata()
This call retrieves property information about metadata components in your
organization. Data is returned for the components that match the criteria specified in the
queries parameter. The queries array can contain up to three ListMetadataQuery queries for each call. This call supports every metadata type:
both top-level, such as CustomObject and ApexClass, and child types, such as CustomField and
RecordType.
Syntax
Usage
This call is useful when you want to identify individual components in
package.xml for a retrieve() call or if you want a
high-level view of particular metadata types in your organization. For example, you could
use this call to return a list of names of all the CustomObject or Layout components in
your organization, and use this information to make a subsequent retrieve() call to return a subset of
these components. For more information about working with package.xml,
see Deploying and Retrieving Metadata.
Permissions
Your client application must be logged in with the Modify All Data or Modify Metadata Through Metadata API Functions permission.
Sample Code—Java
The sample code below lists information about your custom objects. The code assumes that the SOAP binding has already been established.
Arguments
| Name | Type | Description |
|---|---|---|
| queries | ListMetadataQuery[] | A list of objects that specify which components you are interested in. |
| asOfVersion | double | The API version for the metadata listing request. If you don't specify a value in this field, it defaults to the API version specified when you logged in. This field allows you to override the default and set another API version so that, for example, you could list the metadata for a metadata type that was added in a later version than the API version specified when you logged in. This field is available in API version 18.0 and later. |