Newer Version Available

This content describes an older version of this product. View Latest

Index

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.

File Suffix and Directory Location

Indexes are user-defined and are part of the custom object definition for big objects. See CustomObject for more information.

Version

The Index type is available in API version 41.0 and later.

Fields

Field Name Field Type Description
fields IndexField[] The definition of the fields in the index.
label string Required. This name is used to refer to the big object in the user interface. Available in API version 41.0 and later.

IndexField

Defines which fields make up the index, their order, and sort direction. The order in which the fields are defined determines the order fields are listed in the index.

Field Name Field Type Description
name string Required. The API name for the field that’s part of the index. This value must match the fullName value for the corresponding field in the fields section and be marked as required.

When querying a big object record via SOQL and passing the results as arguments to the delete API, if any index field name has a leading or trailing white space, you can't delete the big object record.

Warning

sortDirection string Required. The sort direction of the field in the index. Valid values are ASC for ascending order and DESC for descending order.

Declarative Metadata Sample Definition

The following is an example of an index contained within the definition of a custom big object, Customer_Interactions__b.object.

1<?xml version="1.0" encoding="UTF-8"?>
2<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
3
4    <deploymentStatus>Deployed</deploymentStatus>
5
6// Define the fields within the big object
7    <fields>
8        <fullName>Purchase__c</fullName>
9        <label>Purchase</label>
10        <length>16</length>
11        <required>false</required>
12        <type>Text</type>
13        <unique>false</unique>
14    </fields>
15    
16    <fields>
17        <fullName>Order_Number__c</fullName>
18        <label>Order Number</label>
19        <length>16</length>
20        <required>false</required>
21        <type>Text</type>
22        <unique>true</unique>
23    </fields>
24    
25    <fields>
26        <fullName>Platform__c</fullName>
27        <label>Platform</label>
28        <length>16</length>
29        <required>true</required>
30        <type>Text</type>
31        <unique>false</unique>
32    </fields>
33
34    <fields>
35        <fullName>Account__c</fullName>
36        <label>User Account</label>
37        <referenceTo>Account</referenceTo>
38        <relationshipName>User_Account</relationshipName>
39        <required>true</required>
40        <type>Lookup</type>
41    </fields>
42
43    <fields>
44        <fullName>Order_Date__c</fullName>
45        <label>Order Date</label>
46        <required>true</required>
47        <type>DateTime</type>
48    </fields>
49
50// Define the index
51    <indexes>
52        <fullName>CustomerInteractionsIndex</fullName>
53        <label>Customer Interactions Index</label>
54        <fields>
55            <name>Account__c</name>
56            <sortDirection>DESC</sortDirection>
57        </fields>
58        <fields>
59            <name>Platform__c</name>
60            <sortDirection>ASC</sortDirection>
61        </fields>
62        <fields>
63            <name>Order_Date__c</name>
64            <sortDirection>DESC</sortDirection>
65        </fields>
66    </indexes>
67    
68    <label>Customer Interaction</label>
69    <pluralLabel>Customer Interactions</pluralLabel>
70</CustomObject>

Wildcard Support in the Manifest File

This metadata type doesn’t support the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.