No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
Listing Components for a Metadata Type
The listMetadata target retrieves property information about metadata components in your organization. This target is useful when you want to identify individual components in package.xml for a retrieval or if you want a high-level view of particular metadata types in your organization. For example, you could use this target to return a list of names of all the CustomObject or Layout components in your organization, and use this information to make a subsequent retrieval to return a subset of these components. The following parameters may be set for each <sf:listMetadata> target:
| Field | Description |
|---|---|
| username | Required. The Salesforce username for login. The username associated with this connection must have the “Modify All Data” permission. Typically, this is only enabled for System Administrator users. |
| password | Required. The password you use to log into the organization associated with this project. If you are using a security token, paste the 25-digit token value to the end of your password. |
| serverurl | Optional. The Salesforce server URL (if blank, defaults to login.salesforce.com). To connect to a sandbox instance, change this to test.salesforce.com. |
| metadataType | Required. The name of the metadata type for which you are retrieving property information; for example, CustomObject for custom objects, or Report for custom reports. For a full list of allowed values, see Component Types. |
| folder | The folder associated with the component. This field is required for components that use folders, such as Dashboard, Document, EmailTemplate, or Report. |
| apiVersion | Optional. The API version to use for the metadata. The default is 33.0. |
| resultFilePath | Optional. The path of the output file where results are stored. The default output is the console. Directing the output to a file makes it easier to extract the relevant information for your package.xml manifest file. |
| trace | Optional. Defaults to false. Prints the SOAP requests and responses to the console. Note that this will show the user's password in plain text during login. |
To get property information for components of one metadata type, such as CustomObject, specify a target in the build.xml file using <sf:listMetadata>.
1<target name="listMetadata">
2 <sf:listMetadata
3 username="${sf.username}"
4 password="${sf.password}"
5 serverurl="${sf.serverurl}"
6 metadataType="CustomObject"
7 resultFilePath="listMetadata/list.log"/>
8</target>The following example uses a component that resides in a folder.
1<target name="listMetadata">
2 <sf:listMetadata
3 username="${sf.username}"
4 password="${sf.password}"
5 serverurl="${sf.serverurl}"
6 metadataType="Report"
7 folder="Marketing_Reports"
8 resultFilePath="listMetadata/list.log"/>
9</target>