If you wish to include a Boolean checkbox field on a search form in Salesforce, you have a couple of options depending on whether you wish to specify the search value as an administrator or allow your front end visitors select their own search value.
Defining the value as an administrator with a hidden field
To include a Boolean checkbox field as hidden Salesforce Element on the Search Form of a Directory:
- Open the Directories page to which you wish to add the field
- Go to the Search Form tab
- Click Add Salesforce Element
- For Salesforce Field, select the field you wish to include
- For Hidden, choose Yes For Default Value, enter TRUE to return only Salesforce records for which the checkbox checked. To return only records from Salesforce where the checkbox is not checked, enter FALSE.Click Save
Allowing front end users to define the search value
To include a Boolean checkbox field as Salesforce Element front end visitors can search with on the Search Form of a Directory:
- Open the Directories page to which you wish to add the field
- Go to the Search Form tab
- Click Add Salesforce Element
- For Salesforce Field, select the field you wish to include
- For Display as Checkbox, choose No if you wish the field to be shown as a radio button with the options of Yes and No. Choose Yes if you wish the field to be shown as a single checkbox.
If the field is shown as a radio button, it's default state will have neither selected. If the end user doesn't select Yes or No from the options, the field will be ignored when querying Salesforce and records will returned regardless of their field value. Once a selection is made, only records that match that selected value will be returned.
If the field is shown as a checkbox, it's default state will be unchecked. If the end user doesn't check the checkbox, the field will be ignored when querying Salesforce and records will returned regardless of their field value. If the checkbox is checked, only records with their fields checked will be returned.
Currently, once a value is selected by the end user for either version of the Boolean checkbox field, the only way to returned the form to the NULL state of the field (e.g., so it is disregarded in the search query) is for the end user to click the Start Over button of the Search Form. - For Hidden, choose No
- For Default Value, leave this blank
- Click Save