No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
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:
1Account
2MyCustomObject__cFor sample Java code that creates a custom object, see Step 3: Walk Through the Java 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.
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. |
| compactLayoutAssignment | string | The compact
layout assigned to this custom object. This field is available in API version 29.0 and later. |
| compactLayouts | CompactLayout[] | A list of compact layouts
associated with the object. This field is available in API version 29.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:
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:
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 SOAP API Developer's Guide. |
| enableEnhancedLookup | boolean | Indicates whether the custom object is enabled for enhanced lookups (true) or not (false). In API version 28.0 and later, this field can also be used for the Account, Contact, and User objects. 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 history tracking (true) or not (false). Also available for standard objects in API version 29.0 and later. |
| 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 | Indicates the gender of the noun. This is used for languages where words need different treatment depending on their gender. |
| household | boolean | This field supports relationship groups, a feature available only with 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. This field has been removed as of API version 30.0 and is only available in prior versions. The metadata associated with a lookup filter is now represented by the lookupFilter field in the CustomField component. |
| 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:
|
| 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 noun 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
1<?xml version="1.0" encoding="UTF-8"?>
2<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
3 <deploymentStatus>Deployed</deploymentStatus>
4 <description>just a test object with one field for eclipse ide testing</description>
5 <fields>
6 <fullName>Comments__c</fullName>
7 <description>add your comments about this object here</description>
8 <inlineHelpText>This field contains comments made about this object</inlineHelpText>
9 <label>Comments</label>
10 <length>32000</length>
11 <type>LongTextArea</type>
12 <visibleLines>30</visibleLines>
13 </fields>
14 <label>MyFirstObject</label>
15 <nameField>
16 <label>MyFirstObject Name</label>
17 <type>Text</type>
18 </nameField>
19 <pluralLabel>MyFirstObjects</pluralLabel>
20 <sharingModel>ReadWrite</sharingModel>
21</CustomObject>