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 7CRUD-Based CallsUse the following CRUD-based calls to work with metadata <strong>com</strong>ponents in a manner similar to how synchronous <strong>API</strong> callsin the enterprise WSDL act upon objects.create()Adds one or more new metadata <strong>com</strong>ponents to your organization asynchronously.This call can be used to create any of the objects that extend <strong>Metadata</strong>. For more details, see <strong>Metadata</strong> Components and Typeson page 75.SyntaxAsyncResult[] = metadatabinding.create(<strong>Metadata</strong>[] metadata);UsageUse this call to add one or more metadata <strong>com</strong>ponents to your organization.PermissionsYour client application must be logged in with the “Modify All Data” permission.Required FieldsRequired fields are determined by the metadata <strong>com</strong>ponents being created. For more information about specific <strong>com</strong>ponenttypes, see <strong>Metadata</strong> Components and Types on page 75.Valid Data ValuesYou must supply values that are valid for the field’s data type, such as integers for integer fields (not alphabetic characters). Inyour client application, follow the data formatting rules specified for your programming language and development tool (yourdevelopment tool handles the appropriate mapping of data types in SOAP messages).String ValuesWhen storing values in string fields, the <strong>API</strong> trims any leading and trailing whitespace. For example, if the value of a labelfield is entered as "MyObject " the value is stored in the database as "MyObject".Basic Steps for Creating <strong>Metadata</strong> ComponentsUse the following process to create metadata <strong>com</strong>ponents:1. Design an array and populate it with the <strong>com</strong>ponents you want to create. All <strong>com</strong>ponents must be of the same type.2. Call create() with the <strong>com</strong>ponent array passed in as an argument.42

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

Saved successfully!

Ooh no, something went wrong!