Documentation Version
Winter '16 (API version 35.0)
  • Winter '16 (API version 35.0) 35.0
  • Summer '15 (API version 34.0) 34.0
  • Spring '15 (API version 33.0) 33.0
  • Winter '15 (API version 32.0) 32.0
  • Summer '14 (API version 31.0) 31.0
  • Spring '14 (API version 30.0) 30.0
  • Winter '14 (API version 29.0) 29.0
  • English


Represents the metadata associated with a record type. Record types let you offer different business processes, picklist values, and page layouts to different users. For more information, see “Record Types” in the Salesforce online help. Use this metadata type to create, update, or delete record type definitions for a custom object. This type extends the Metadata metadata type and inherits its fullName field.



Retrieving a component of this metadata type in a project makes the component appear in any Profile and PermissionSet components that are retrieved in the same package.


Record types are available in API version 12.0 and later.


Field Field Type Description
active boolean Required. Indicates whether or not the record type is active.
businessProcess string The fullName of the business process associated with the record type. This field is required in record types for lead, opportunity, solution, and case, and not allowed otherwise. See BusinessProcess.

This field is available in API version 17.0 and later.

compactLayoutAssignment string Represents the compact layout that is assigned to the record type.

This field is available in API version 29.0 and later.

description string Record type description. Maximum of 255 characters.
fullName string Record type name. The fullName can contain only underscores and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. If this field contained characters before version 14.0 that are no longer allowed, the characters were stripped out of this field, and the previous value of the field was saved in the label field.

Inherited from the Metadata component, this field is not defined in the WSDL for this component. It must be specified when creating, updating, or deleting. See create() to see an example of this field specified for a call.

This value cannot be null.

label string Required. Descriptive label for the record type. The list of characters allowed in the fullName field has been reduced for versions 14.0 and later. This field contains the value contained in the fullName field before version 14.0.
picklistValues RecordTypePicklistValue[] Represents a set of values for a picklist.


RecordTypePicklistValue represents the combination of picklists and valid values that define a record type:

Field Name Field Type Description
picklist string Required. The name of the picklist.
values PicklistValue One or more of the picklist values in the picklist. Each value defined is available in the record type that contains this component.

Java Sample

The following sample uses two record types. For the complete sample that includes profiles and picklists, see Profile.

public void recordTypeSample() {
  try {
    // Employees and managers have different access
    // to the state of the expense sheet
    RecordType edit = new RecordType();
    PicklistValue unsubmitted = new PicklistValue();
    PicklistValue submitted = new PicklistValue();
    RecordTypePicklistValue editStatuses = 
        new RecordTypePicklistValue();
        new PicklistValue[] {unsubmitted, submitted});
        new RecordTypePicklistValue[] {editStatuses});
    AsyncResult[] arsEdit =
        metadataConnection.create(new Metadata[] {edit});
    RecordType approve = new RecordType();
    PicklistValue approved = new PicklistValue();
    PicklistValue rejected = new PicklistValue();
    RecordTypePicklistValue approveStatuses = 
        new RecordTypePicklistValue();
        new PicklistValue[] {approved, rejected});
        new RecordTypePicklistValue[] {approveStatuses});
    AsyncResult[] arsApprove =
      metadataConnection.create(new Metadata[] {approve});
  } catch (ConnectionException ce) {

Declarative Metadata Sample Definition

The definition of a record type in a custom object is shown below:

<CustomObject xmlns="">
. . .
        <fullName>My First Recordtype</fullName>
 . . .