Additional Field Filters
Additional field filters enable the use of fields on the Contact object as filters.
Setup
The fields available for use in filters are defined in the Daxtra Search Filter (seven20__Daxtra_Search_Filter__mdt) custom metadata table.
To add a new field to the list, create a new metadata record, populating the following field values:
-
Label - A friendly name for the filter record; this is not displayed to end users
-
Filter Field - The field API name on the Contact object
noteOnly field labels will be presented to the end user.
-
Daxtra Search Filter Name - An auto generated API name for the filter record; this value only needs changing in case of duplicates
Relationship fields and those unavailable for use in a SOQL query, such as Text Area (Rich) and Text Area (Long) fields, are not supported.
Don't forget to assign read permissions to the fields you wish to use as filters.
Field operators
End users first select a field, which then presents different operators to them depending on the field type. These field operators are translated into SOQL WHERE clause operators at run time. The operator to SOQL equivalent is as follows:
| Field Operator | SOQL Equivalent | Notes | Custom Label Developer Name |
|---|---|---|---|
| Equals | = | Filter_Operator_Equals | |
| Not Equals | != | Filter_Operator_Not_Equals | |
| Contains | LIKE | e.g. %value% | Filter_Operator_Contains |
| Does Not Contain | NOT LIKE | e.g. (NOT field LIKE "%value%") | Filter_Operator_Does_Not_Contain |
| Starts With | LIKE | e.g. value% | Filter_Operator_Starts_With |
| Ends With | LIKE | e.g. %value | Filter_Operator_Ends_With |
| Greater Than | > | Filter_Operator_Greater_Than | |
| Less Than | < | Filter_Operator_Less_Than | |
| Greater Or Equal To | >= | Filter_Operator_Greater_Than_Or_Equals | |
| Less Or Equal To | <= | Filter_Operator_Less_Than_Or_Equals | |
| One of | Supports picklist and multipicklist | Filter_Operator_One_of | |
| Exclude | Supports picklist and multipicklist | Filter_Operator_Exclude |
User inputted field values are sanitised.
Query logic
Basic mode
By default, all additional field filters are combined using the AND operator. This can be switched to OR by clicking on the Or radio button at the top of the section.
For example, if the following fields are selected:
- CandidateStatus Equals "New"
- CreatedDate Greater Than "2021-01-01"
Depending on the logic selected, the following SOQL WHERE clause would be generated:
- AND -
CandidateStatus = 'New' AND CreatedDate > 2021-01-01 - OR -
CandidateStatus = 'New' OR CreatedDate > 2021-01-01
Advanced mode
When using Advanced Search, advanced filtering can be achieved with the use of custom logic.
Special field behaviours and considerations
- RecordTypeId - Record type options are provided as a picklist
- MailingCountry - Would be presented as a free text. Please use MailingCountryCode instead
- MailingState - Would be presented as a free text. Please use MailingStateCode instead
- OtherCountry - Would be presented as a free text. Please use OtherCountryCode instead
- OtherState - Would be presented as a free text. Please use OtherStateCode instead