12.07.2015 Views

Database.com Metadata API Developer's Guide - Salesforce.com

Database.com Metadata API Developer's Guide - Salesforce.com

Database.com Metadata API Developer's Guide - Salesforce.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 9Result ObjectsUse the following objects to get the results of your file-based or CRUD-based calls.AsyncResultPoll the values in this object to determine when an asynchronous metadata call has <strong>com</strong>pleted, and whether it was successfulor not.The asynchronous metadata calls create(), update(), and delete() return an array of AsyncResult objects. Each elementin the array corresponds to an element in the array of metadata <strong>com</strong>ponents passed in the call.Use the checkStatus() call against each object to discover when the call is <strong>com</strong>pleted for that object. <strong>Database</strong>.<strong>com</strong> updateseach AsyncResult object as the call <strong>com</strong>pletes, or when any errors occur.The retrieve() call uses AsyncResult similarly, though you must subsequently use checkDeployStatus() orcheckRetrieveStatus() respectively to get more status information for the deployment or retrieval.In <strong>API</strong> version 29.0, <strong>Database</strong>.<strong>com</strong> moved several properties from the AsyncResult object to the DeployResult on page 62object, and added several new ones, to improve the process for getting information about deployments. For more informationabout these changes, see deploy() on page 25.For <strong>API</strong> versions 29.0 and later, the AsyncResult object has the following properties.NamedoneidmessageTypebooleanIDstringDescriptionRequired. Indicates whether the call has <strong>com</strong>pleted (true) or not(false).Required. ID of the <strong>com</strong>ponent being created, updated, deleted, deployed,or retrieved.Message corresponding to the statusCode field returned, if any.stateAsyncRequestState(enumeration oftype string)Required. The AsyncRequestState object has one of four possiblevalues:• Queued: This call has not started. It is waiting in a queue.• InProgress: This call has started, but has not <strong>com</strong>pleted yet.• Completed: This call has <strong>com</strong>pleted.• Error: An error occurred. See the statusCode for moreinformation.59

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!