Newer Version Available
ListView
This type extends the Metadata metadata type and inherits its fullName field. See “Create a Custom List View in Salesforce Classic” in Salesforce Help.
Declarative Metadata File Suffix and Directory Location
List views are stored within a CustomObject component. The component can represent a custom object or a standard object, such as an account.
Version
ListView components for custom objects are available in API version 14.0 and later. ListView components for standard objects, such as accounts, are available in API version 17.0 and later.
Fields
| Field | Field Type | Description |
|---|---|---|
| booleanFilter | string | This field represents an Advanced Option for a filter. Advanced Options in filters allow you to build up filtering conditions that use a mixture of AND and OR boolean operators across multiple filter line items. For example, (1 AND 2) OR 3 finds records that match both the first two filter line items or the third. |
| columns | string[] | The list of fields in the list view. The field name relative to the object name, for example MyCustomField__c, is specified for each custom field. |
| division | string |
If your organization uses divisions
to segment data and you have the “Affected by
Divisions” permission, records in the list view must
match this division. This field is only available if you are
searching all records. This field is available in API version 17.0 and later. |
| filterScope | FilterScope (enumeration of type string) | Required. This field indicates whether you are filtering by owner or viewing all records. |
| filters | ListViewFilter[] | The list of filter line items. |
| fullName | string | Required. 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 createMetadata() to see an example of this field specified for a call. |
| label | string | Required. The list view name. |
| language | Language |
The language used for filtering if
your organization uses the Translation Workbench and you are
using the startsWith or
contains operator. The
values entered as search terms must be in the same language as
the filter language. For a list of valid language values, see Language. This field is available in API version 17.0 and later. |
| queue | string | The name of a queue. Objects are sometimes assigned to a queue so that the users who have access to the queue can monitor and manage them. When you create a queue, a corresponding list view is automatically created. See “Create Queues” in the Salesforce online help. |
| SharedTo |
This field is available in API version 17.0 and later. |
ListViewFilter
ListViewFilter represents a filter line item.
| Field | Field Type | Description |
|---|---|---|
| filter | string | Required. Represents the field specified in the filter. |
| operation | FilterOperation (enumeration of type string) | Required. The operation used by the filter, such as equals. The valid values are listed in FilterOperation. |
| value | string | Represents the value of the filter item being operated upon, for example, if the filter is my_number_field__c > 1, the value of value is 1. |
FilterScope
This is an enumeration of type string that represents the filtering criteria for the records. The valid values are listed in the table below:
Declarative Metadata Sample Definition
A sample XML definition of a list view in a custom object is shown below.
1<?xml version="1.0" encoding="UTF-8"?>
2<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
3. . .
4 <listViews>
5 <fullName>All_Mileages</fullName>
6 <filterScope>everything</filterScope>
7 <label>All Mileages</label>
8 </listViews>
9 <listViews>
10 <fullName>My_Mileages</fullName>
11 <booleanFilter>1 AND 2</booleanFilter>
12 <columns>NAME</columns>
13 <columns>CREATED_DATE</columns>
14 <filterScope>mine</filterScope>
15 <filters>
16 <field>NAME</field>
17 <operation>equals</operation>
18 <value>Eric Bristow</value>
19 </filters>
20 <filters>
21 <field>City__c</field>
22 <operation>equals</operation>
23 <value>Paris</value>
24 </filters>
25 <label>My Mileages</label>
26 </listViews>
27. . .
28</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.