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 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.
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.

1<?xml version="1.0" encoding="UTF-8"?>
2<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
3....
4    <label>Campaign Interaction</label>
5      <description>Stores high-volume campaign interaction records.</description>
6      <fields>
7          <fullName>CampaignId__c</fullName>
8          <label>Campaign Id</label>
9          <type>Text</type>
10          <length>18</length>
11          <required>true</required>
12      </fields>
13      <fields>
14          <fullName>InteractionType__c</fullName>
15          <label>Interaction Type</label>
16          <type>Text</type>
17          <length>40</length>
18      </fields>
19      <marketingObjectIndexes>
20          <fields>
21              <name>CampaignId__c</name>
22              <ordinal>1</ordinal>
23              <sortDirection>ASC</sortDirection>
24          </fields>
25          <label>Primary Key</label>
26          <isUnique>true</isUnique>
27          <isPrimary>true</isPrimary>
28      </marketingObjectIndexes>
29....
30</CustomObject>

MarketingObjectIndex

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

Unlike Index, 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.