Newer Version Available
describeValueType()
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.
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.