---
schema_version: "1"
id: fedb763ba32defb9d852282eb0c44602e85715ed4ad971978fcd4fd9b13cc193
title: MarketingObject
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_marketingobject.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_marketingobject.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 53d0642cbe6e9a55d898c9b83c158e4007373872cd46826d703c1de409eca26d
description: A marketing object is a high-volume, low-latency custom object that stores data for personalizing content in your marketing campaigns. A marketing object supports a subset of CustomObject fields and uses the __mo suffix instead of __c.
---
# MarketingObject

A marketing object is a high-volume, low-latency custom object that stores data for personalizing content in your marketing campaigns. A marketing object supports a subset of CustomObject fields and uses the \_\_mo suffix instead of \_\_c.

## Declarative Metadata File Suffix and Directory Location

Marketing objects are defined as part of the custom object definition. See [CustomObject](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customobject.htm "Represents a custom object that stores data unique to your org or an external object that maps to data stored outside your org.") for more information.

## Version

MarketingObject components are available in API version 68.0 and later.

## Fields

| Field | Field Type | Description |
| --- | --- | --- |
| label | string | Required. A label that represents the object throughout the Salesforce user interface. |
| description | string | A description of the object. Maximum of 1,000 characters. |
| fields | CustomField\[\] | Represents one or more fields on the marketing object. See [CustomField](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customfield.htm "Represents the metadata associated with a field. Use this metadata type to create, update, or delete custom field definitions on standard, custom, and external objects or standard field definitions on standard objects."). |
| marketingObjectIndexes | MarketingObjectIndex\[\] | Defines one or more indexes on the marketing object. |

Marketing objects don't support other CustomObject fields.

## Declarative Metadata Sample Definition

The following is a sample XML definition of a lead business process.

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
....
    <label\>Campaign Interaction</label\>
      <description\>Stores high-volume campaign interaction records.</description\>
      <fields\>
          <fullName\>CampaignId\_\_c</fullName\>
          <label\>Campaign Id</label\>
          <type\>Text</type\>
          <length\>18</length\>
          <required\>true</required\>
      </fields\>
      <fields\>
          <fullName\>InteractionType\_\_c</fullName\>
          <label\>Interaction Type</label\>
          <type\>Text</type\>
          <length\>40</length\>
      </fields\>
      <marketingObjectIndexes\>
          <fields\>
              <name\>CampaignId\_\_c</name\>
              <ordinal\>1</ordinal\>
              <sortDirection\>ASC</sortDirection\>
          </fields\>
          <label\>Primary Key</label\>
          <isUnique\>true</isUnique\>
          <isPrimary\>true</isPrimary\>
      </marketingObjectIndexes\>
....
</CustomObject\>

## MarketingObjectIndex

Represents an index defined on a marketing object. Referenced from the marketingObjectIndexes field of CustomObject.

Unlike [Index](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_index.htm "Represents an index defined within a custom big object. Use this metadata type to define the composite primary key (index) for a custom big object. This type extends the Metadata metadata type and inherits its fullName field."), which is its own Metadata component with a unique fullName, MarketingObjectIndex is a value type that's always defined inline within the marketing object's CustomObject definition. An index doesn't have a fullName. Its only identifier is label.

| Field | Field Type | Description |
| --- | --- | --- |
| fields | MarketingObjectIndexField\[\] | The ordered list of fields that make up the index. |
| isPrimary | boolean | Required. Specifies whether this index is the primary key index for the marketing object. Every marketing object must define exactly one index with isPrimary set to true. |
| isUnique | boolean | Required. If true, the fields in the index must be unique. |
| label | string | Required. A label that identifies the index. This is the only identifier for a MarketingObjectIndex—it doesn't have a fullName. |

Usage notes:

- A marketing object supports a maximum of 10 indexes, and each index supports a maximum of 5 fields. (Both limits are org-configurable defaults.)
- A marketing object must define exactly one index with isPrimary set to true. If the org requires it, every field referenced by the primary-key index must also be marked required on the marketing object.

## MarketingObjectIndex

Represents a single field participating in a MarketingObjectIndex.

| Field | Field Type | Description |
| --- | --- | --- |
| name | string | Required. The API name of the CustomField being indexed. |
| ordinal | int | Required. The position of this field within the index. The first field has a value of 1. |
| sortDirection | string | The sort order for this field within the index. Valid values are ASC and DESC. |

- [← Previous](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_listview.htm "ListView")
- [Next →](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/namedfilter.htm "NamedFilter")

#### See Also

- [CustomObject](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customobject.htm "Represents a custom object that stores data unique to your org or an external object that maps to data stored outside your org.")
- [CustomField](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customfield.htm "Represents the metadata associated with a field. Use this metadata type to create, update, or delete custom field definitions on standard, custom, and external objects or standard field definitions on standard objects.")