Newer Version Available

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

describeValueType()

This call retrieves the metadata describing a given value type.

describeValueType() accepts a namespace and an entity name, and returns a DescribeValueTypeResult object. This call is available in API version 33.0 and later.

Syntax

1DescribeValueTypeResult = ToolingConnection.describeValueType("{namespace}entity");

Example

Describe Apex class metadata in the Tooling namespace:

1DescribeValueTypeResult = ToolingConnection.describeValueType("{urn:metadata.tooling.soap.sforce.com}ApexClass");

Describe Apex class metadata in the Metadata namespace:

1DescribeValueTypeResult = ToolingConnection.describeValueType("{http://soap.sforce.com/2006/04/metadata}ApexClass");

Arguments

Name Type Description
type string The name of the value type for which you want metadata; for example, myCustomClass.

Permissions

Your client application must be logged in with the “Modify All Data” permission.

Sample Code—Java

1swfobject.registerObject("clippy.codeblock-3", "9");public void describeValueType() {
2  try {
3    DescribeValueTypeResult result = toolingConnection.describeValueType("{urn:metadata.tooling.soap.sforce.com}ApexClass");
4    StringBuffer sb = new StringBuffer();
5
6    for(ValueTypeField field : result.getValueTypeFields()) {
7      sb.append("***************************************************\n");
8      sb.append("Name: " + field.getName() + "\n");
9      sb.append("MinOccurs: " + field.getMinOccurs() + "\n");
10      sb.append("SoapType: " + field.getSoapType() + "\n");
11      sb.append("***************************************************\n");
12    }
13    System.out.println(sb.toString());
14  } catch (ConnectionException ce) {
15    ce.printStackTrace();
16  }
17}
18