Newer Version Available

This content describes an older version of this product. View Latest

create()

Deprecated. Adds one or more new metadata components to your organization asynchronously. This call is removed as of API version 31.0 and is available in earlier versions only. Use createMetadata() instead.

Syntax

1AsyncResult[] = metadatabinding.create(Metadata[] metadata);

Usage

Use this call to add one or more metadata components to your organization.

Version

This call is available in API version 30.0 and earlier only. This call is not available in API version 31.0 and later. Use createMetadata() instead.

Permissions

Your client application must be logged in with the “Modify All Data” permission.

Required Fields

Required fields are determined by the metadata components being created. For more information about specific component types, see Metadata Components and Types.

Valid Data Values

You must supply values that are valid for the field’s data type, such as integers for integer fields (not alphabetic characters). In your client application, follow the data formatting rules specified for your programming language and development tool (your development tool handles the appropriate mapping of data types in SOAP messages).

String Values

When storing values in string fields, the API trims any leading and trailing whitespace. For example, if the value of a label field is entered as "MyObject " the value is stored in the database as "MyObject".

Basic Steps for Creating Metadata Components

Use the following process to create metadata components:

  1. Design an array and populate it with the components you want to create. All components must be of the same type.
  2. Call create() with the component array passed in as an argument.
  3. An AsyncResult object is returned for each component you triy to create, and is updated with status information as the operation moves from a queue to completed or error state. Call checkStatus() in a loop until the status values in AsyncResult indicate that all create operations are completed. Start with a wait time of one second between iterations of checkStatus() calls, and double the wait time each time you make a subsequent call.

Sample Code—Java

See Step 3: Walk Through the Java Sample Code for sample Java code using the create() call.

Arguments

Name Type Description
metadata Metadata[]

Array of one or more metadata components.

Limit: 10.

You must submit arrays of only one type of component. For example, you could submit an array of 10 custom objects or 10 profiles, but not a mix of both types.

Response

AsyncResult[]