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.

CRUD-Based Callscreate<strong>Metadata</strong>()}// set initial wait time to one second in millisecondslong waitTimeMilliSecs = 1000;while (!asyncResult.isDone()) {Thread.sleep(waitTimeMilliSecs);// double the wait time for the next iterationwaitTimeMilliSecs *= 2;asyncResult = metadataConnection.checkStatus(new String[] {asyncResult.getId()})[0];System.out.println("Status is: " + asyncResult.getState());}if (asyncResult.getState() != AsyncRequestState.Completed) {System.out.println(asyncResult.getStatusCode() + " msg: " +asyncResult.getMessage());}} catch (InterruptedException ie) {ie.printStackTrace();} catch (ConnectionException ce) {ce.printStackTrace();}ArgumentsNamemetadataTypeUpdate<strong>Metadata</strong>[]DescriptionArray of one or more Update<strong>Metadata</strong> data structures that representthe <strong>com</strong>ponents you wish to update.Limit: 10.You must submit arrays of only one type of <strong>com</strong>ponent. For example,you could submit an array of 10 custom objects or 10 profiles, butnot a mix of both types.Update<strong>Metadata</strong>One or more Update<strong>Metadata</strong> objects are defined in the metadata argument. This object can be used to update any of theobjects that extend <strong>Metadata</strong>. For more details, see <strong>Metadata</strong> Components and Types on page 75. Each Update<strong>Metadata</strong>object has the following fields:FieldcurrentNamemetadataField Typestring<strong>Metadata</strong>DescriptionThe <strong>API</strong> name of the <strong>com</strong>ponent or field before the update. Forexample, if you wanted to update a CustomObject named Foo, thevalue of this field would be Foo__c. This value is supplied becausethis call may change the name, and the value here provides mapping.Full specification of the <strong>com</strong>ponent or field you wish to update.ResponseAsyncResult[]create<strong>Metadata</strong>()Adds one or more new metadata <strong>com</strong>ponents to your organization synchronously.46

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

Saved successfully!

Ooh no, something went wrong!