CustomObject

Represents a custom object that stores data unique to your organization. It extends the Metadata metadata type and inherits its fullName field. You must specify all relevant fields when you create or update a custom object. You cannot update a single field on the object. For more information about custom objects, see “Custom Object Record Overview” in the Salesforce online help.

You can also use this metadata type to work with customizations of standard objects, such as accounts. For an example, see Standard Objects.

All metadata components have a fullName field, which must be fully specified for any custom object.

For example, the following are fully specified names:

Account
MyCustomObject__c

For sample Java code that creates a custom object, see Step 4: Walk Through the Sample Code .

Declarative Metadata File Suffix and Directory Location

Custom object names are automatically appended with __c. The file suffix is .object for the custom object (or standard object) file.

Custom and standard objects are stored in the objects folder in the corresponding package directory.

Note
Retrieving a component of this metadata type in a project makes the component appear in the Profile component as well.

Version

Custom objects are available in API version 10.0 and later.

Fields

Unless otherwise noted, all fields are createable, filterable, and nillable.

Field Name Field Type Description
actionOverrides ActionOverride[] A list of action overrides on a standard or custom object.

This field is available in API version 18.0 and later.

businessProcesses BusinessProcess[] A list of business processes associated with the object.

This field is available in API version 17.0 and later.

customHelp string The s-control that contains the help content if this custom object has customized help content. This field is available in API version 14.0 and later.
customHelpPage string The Visualforce page that contains the help content if this custom object has customized help content. This field is available in API version 16.0 and later.
customSettingsType CustomSettingsType (enumeration of type string) When this field is present, this component is not a custom object, but a custom setting. This field returns the type of custom setting. The following string values are valid:
  • List—static data stored in cache and accessed as part of your application and available organization-wide.
  • Hierarchy—static data stored in cache and accessed as part of your application and available based on a hierarchy of user, profile or organization. This is the default value.

This field is available in API version 17.0 and later.

customSettingsVisibility CustomSettingsVisibility (enumeration of type string) When this field is present, this component is not a custom object, but a custom setting. This field returns the visibility of the custom setting. The following string values are valid:
  • Public—if the custom setting is packaged, it is accessible to all subscribing organizations.
  • Protected—if the custom setting is in a managed package, it is only accessible to the developer organization. Subscribing organizations cannot access it. This is the default value.

This field is available in API version 17.0 and later.

deploymentStatus DeploymentStatus(enumeration of type string) Indicates the deployment status of the custom object.
deprecated boolean Reserved for future use.
description string A description of the object. Maximum of 1000 characters.
enableActivities boolean Indicates whether the custom object is enabled for activities (true) or not (false).
enableDivisions boolean Indicates whether the custom object is enabled for divisions (true) or not (false). For more information about the Division object, see the Web Services API Developer's Guide.
enableEnhancedLookup boolean Indicates whether the custom object is enabled for enhanced lookups (true) or not (false). Enhanced lookups provide an updated lookup dialog interface that gives users the ability to filter, sort, and page through search results as well as customize search result columns. For more information about enhanced lookups, see “Enabling Enhanced Lookups” in the Salesforce online help.
enableFeeds boolean Indicates whether the custom object is enabled for feed tracking (true) or not (false). For more information, see “Customizing Chatter Feed Tracking” in the Salesforce online help.

This field is available in API version 18.0 and later.

enableHistory boolean Indicates whether the custom object is enabled for audit history (true) or not (false).
enableReports boolean Indicates whether the custom object is enabled for reports (true) or not (false).
fields CustomField[] Represents one or more fields in the object.
fieldSets FieldSet Defines the field set that exists on this object.
fullName string Inherited from Metadata, this field is not defined in the WSDL for this metadata type. 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.

gender Gender
Gender of the name to support translation for languages that indicate gender in nouns. Valid values are:
  • Neuter
  • Masculine
  • Feminine
household boolean This field supports relationship groups, a feature available only with the Salesforce for Wealth Management. For more information, see “Salesforce for Wealth Management Overview” in the Salesforce online help.
label string Label that represents the object throughout the Salesforce user interface.
listViews ListView[] Represents one or more list views associated with the object.
namedFilter NamedFilter[] Represents the metadata associated with a lookup filter. Use this metadata type to create, update, or delete lookup filter definitions.

This field is available in API version 17.0 and later.

nameField CustomField Required. The field that this object's name is stored in. Every custom object must have a name, usually a string or autonumber.

Identifier for the custom object record. This name appears in page layouts, related lists, lookup dialogs, search results, and key lists on tab home pages. By default, this field is added to the custom object page layout as a required field. Every custom object must have a name, usually a string or autonumber.

pluralLabel string Plural version of the label value.
recordTypes RecordType[] An array of one or more record types defined for this object.
recordTypeTrackFeedHistory boolean Indicates whether the record type is enabled for feed tracking (true) or not (false). To set this field to true, the enableFeeds field on the associated CustomObject must also be true. For more information, see “Customizing Chatter Feed Tracking” in the Salesforce online help.

This field is available in API version 19.0 and later.

recordTypeTrackHistory boolean Indicates whether history tracking is enabled for this record type (true) or not (false). To set recordTypeTrackHistory to true the enableHistory field on the associated custom object must also be true.

This field is available in API version 19.0 and later.

searchLayouts SearchLayouts The Search Layouts related list information for a custom object.
sharingModel SharingModel Indicates the sharing model for this custom object. Valid values are:
  • Private
  • Read
  • ReadWrite
Note
You can't change the value of this field through the Metadata API; you must use the Web interface.
sharingReasons SharingReason[] The reasons why the custom object is being shared.
sharingRecalculations SharingRecalculation[] A list of custom sharing recalculations associated with the custom object.
startsWith StartsWith(enumeration of type string) Indicates whether the name starts with a vowel, consonant, or is a special character. This is used for languages where words need different treatment depending on the first character. Valid values are listed in StartsWith.
validationRules ValidationRule[] An array of one or more validation rules on this object.
webLinks Weblink[] An array of one or more weblinks defined for the object.

Declarative Metadata Additional Components

CustomObject definitions may include additional components which are defined in the custom object for declarative metadata. The following components are defined in the CustomObject:

Declarative Metadata Sample Definition

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <deploymentStatus>Deployed</deploymentStatus>
    <description>just a test object with one field for eclipse ide testing</description>
    <fields>
        <fullName>Comments__c</fullName>
        <description>add your comments about this object here</description>
        <inlineHelpText>This field contains comments made about this object</inlineHelpText>
        <label>Comments</label>
        <length>32000</length>
        <type>LongTextArea</type>
        <visibleLines>30</visibleLines>
    </fields>
    <label>MyFirstObject</label>
    <nameField>
        <label>MyFirstObject Name</label>
        <type>Text</type>
    </nameField>
    <pluralLabel>MyFirstObjects</pluralLabel>
    <sharingModel>ReadWrite</sharingModel>
</CustomObject>
© Copyright 2000–2012 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.