Why might I get an error when searching for leads?

When you select a predefined saved search when searching for leads, the search results display a list of the records as predefined in the saved search record sets. You can see the approximate number of items in each saved search, and you can control the number of lead record returned by setting lead search specific profile options.

Custom saved search can sometimes return an error. For example, if a required field, such as lead creation date, lead name, or lead number isn't specified as part of the saved search criteria, then you might receive an error. You should also check what values are set for the lead profile options, Lead Query Default Number of Days (MKL_LEAD_SEARCH_CREATION_RANGE_DEFAULT), and Lead Query Maximum Number of Days (MKL_LEAD_QUERY_IN_N_DAYS) for your environment.

This table lists the profile options that manage how sales lead searches are performed.

Lead Search Profile Options

Profile Option Display Name Default Value Effect

Lead Query Maximum Number of Days (MKL_LEAD_QUERY_IN_N_DAYS)

360

Specify the maximum number of days allowed when searching leads based on the creation date range.

The value for the maximum number of days must be a positive number. If the value isn't a positive number or left blank, the value of 360 days is used.

Lead Query Default Number of Days (MKL_LEAD_SEARCH_CREATION_RANGE_DEFAULT

90

Specify the default number of days used to derive the creation date range for searching leads. The search criterion is derived by using the current date for the creation end date value and the profile option to derive the creation start date value.

For example, if you want leads for the last 15 days to be the default query action, then set the profile value to 15. The default creation date search criteria will have an end date for the current date and the start date will be 15 days prior to the current date. The values can be overridden in the search criteria.

The value for the default number of days must be a positive number. If the value isn't a positive number or left blank, the value of 30 days is used.

This profile option can be defined at both the site and user levels.

Lead Query Warning Threshold Number of Days (MKL_LEAD_SEARCH_CREATION_RANGE_RECOMMENDED)

180

Specify the number of days for the lead creation date search criteria before issuing an alert to the user.

To disable the warning, delete the profile option value.

Lead Search Context-Based Data Security Enabled (MKL_LEAD_CDS_ENABLED)

N

Enable context-based data security policies for improved performance of lead search. The default value is set to N.

Note: If you enable this option, then you must also ensure that the filters in the Lead Overview page, such as My Leads, My Subordinate Leads and so on have the required access in Security Console. Otherwise, your lead data search won't return expected results.

Require Additional Criteria for Lead Search Enabled (MKL_SRCH_ADDL_CRITERIA_REQD)

N

Enable additional search criteria, other than creation date, when searching across all leads, or for searches relying on hierarchy rollups.

See How do I create and manage saved searches? for more information about creating and managing saved searches.