Lookup filters are defined as part of the custom object or standard object definition. See CustomObject for more information.
Unless otherwise noted, all fields are createable, filterable, and nillable.
| Field Name | Field Type | Description |
|---|---|---|
| active | boolean | Required. Indicates whether or not the lookup filter is active. |
| booleanFilter | string | Specifies advanced filter conditions. For more information on advanced filter conditions, see “Filter Logic Tips” in the Salesforce online help. |
| description | string | A description of what this filter does. |
| errorMessage | string | The error message that appears if the lookup filter fails. |
| field | string | Required. The fullName of the custom or standard field associated with the lookup filter. You can associate one relationship field with each lookup filter, and vice-versa. |
| filterItems | FilterItems[] | Required. The set of filter conditions. |
| infoMessage | string | The information message displayed on the page. Use to describe things the user might not understand, such as why certain items are excluded in the lookup filter. |
| 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. |
| isOptional | boolean | Required. Indicates whether or not the lookup filter is optional. |
| name | string | Required. The name of the lookup filter. If you create this field in the user interface, a name is automatically assigned. If you create this field through the Metadata API, you must include the name field. |
| sourceObject | string | The object that contains the lookup field that uses this lookup filter. Set this field if the lookup filter references fields on the source object. |
Lookup filters use additional data types. For more information, see Metadata Field Types.
FilterItems contains the following properties:
| Field | Field Type | Description |
|---|---|---|
| field | string | Represents the field specified in the filter. |
| operation | FilterOperation(enumeration of type string) | Represents the filter operation for this filter item. Valid values are enumerated 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. |
This is an enumeration of type string that lists different filter operations. Valid values are:
<?xml version="1.0" encoding="UTF-8"?> <CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> .... <namedfilters> <fullName>nf_Acc</fullName> <active>true</active> <booleanFilter>1 OR 2</booleanFilter> <field>Account.lk__c</field> <filterItems> <field>Account.Phone</field> <operation>notEqual</operation> <value>x</value> </filterItems> <filterItems> <field>Account.Fax</field> <operation>notEqual</operation> <value>y</value> </filterItems> <name>Acc</name> <sourceObject>Account</sourceObject> </namedfilters> .... </CustomObject>