Newer Version Available

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

describeValueType()

Retrieves the metadata describing a given metadata type (value type).
describeValueType() accepts a namespace and a type name, and returns a DescribeValueTypeResult object. This call is available in API version 33.0 and later.

Syntax

Example

Describe Apex class metadata in the Metadata namespace:

Describe Apex class metadata in the Tooling namespace:

Arguments

Name Type Description
type string The name of the metadata type for which you want metadata; for example, ApexClass. Include the namespace.

Permissions

Your client application must be logged in with the Modify Metadata Through Metadata API Functions or Modify All Data permission.

If a user requires access to metadata but not to data, enable the Modify Metadata Through Metadata API Functions permission. Otherwise, enable the Modify All Data permission.

Note

Sample Code—Java

The following example describes several metadata types by specifying the Metadata namespace. Each metadata type is described using the helper method, doDescribe(), which calls the describeValueType() Metadata API call. The sample retrieves information from the returned DescribeValueTypeResult: a property, the parent field (if any), and the fields. Next, the sample iterates through the fields and outputs information about each field.

To run the previous example with the Tooling WSDL, replace the namespace with the Tooling namespace in the helper function call as follows. Also, use the Tooling connection instead of the Metadata connection to make the describeValueType() call.

After you run the sample, the output looks similar to the following.