isSearchCustom(quote, fieldValuesMap)
Signature
global Boolean isSearchCustom(SObject quote, Map<String,Object> fieldValuesMap)
Parameters
- quote
- Type: SObject
- The current quote.
- fieldValuesMap
- Type: Map<String,Object>
- A map of the search criteria. The map key is a Product2 API name and the value is the desired search value.
Return Value
Type: Boolean
Return True to use custom searching or False to use enhanced searching.
If you use custom searching, Salesforce CPQ calls search for search execution. The search() method lets you build the SOQL query's SELECT and WHERE clauses manually before you perform your query.
If you use enhanced searching, Salesforce CPQ calls getAdditionalSearchFilters for search execution. The getAdditionalSearchFilters method appends a WHERE clause to the existing SOQL query.
Example
In this example, we want a method that returns True if the original search criteria defined and used a Search field for sorting.
global Boolean isSearchCustom(SObject quote, Map<String,Object> fieldValuesMap) {
// This would use CUSTOM mode if a Search field for sorting was defined and used
return fieldValuesMap.get('Sort_By__c') != '';
}