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");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17public void describeValueType() {
18  try {
19    DescribeValueTypeResult result = toolingConnection.describeValueType("{urn:metadata.tooling.soap.sforce.com}ApexClass");
20    StringBuffer sb = new StringBuffer();
21
22    for(ValueTypeField field : result.getValueTypeFields()) {
23      sb.append("***************************************************\n");
24      sb.append("Name: " + field.getName() + "\n");
25      sb.append("MinOccurs: " + field.getMinOccurs() + "\n");
26      sb.append("SoapType: " + field.getSoapType() + "\n");
27      sb.append("***************************************************\n");
28    }
29    System.out.println(sb.toString());
30  } catch (ConnectionException ce) {
31    ce.printStackTrace();
32  }
33}
34