parameterized_search_control: Auxiliary for Controlling Parametrized Searches

View source: R/search.R

parameterized_search_controlR Documentation

Auxiliary for Controlling Parametrized Searches

Description

A function for allowing finer grained control over how a search is performed when not using SOSL

Usage

parameterized_search_control(
  objects = NULL,
  fields_scope = c("ALL", "NAME", "EMAIL", "PHONE", "SIDEBAR"),
  fields = NULL,
  overall_limit = 2000,
  default_limit = 200,
  spell_correction = TRUE
)

Arguments

objects

character; objects to search and return in the response. Multiple objects can be provided as a character vector

fields_scope

character; scope of fields to search in order to limit the resources used and improve performance

fields

character; one or more fields to return in the response for each sobject specified. If no fields are specified only the Ids of the matching records are returned.

overall_limit

numeric; the maximum number of results to return across all objects in the search.

default_limit

numeric; the maximum number of results to return for each of the specified objects. This parameter is ignored if the objects argument is left NULL.

spell_correction

logical; specifies whether spell correction should be enabled for a user’s search.

Value

list of parameters passed onto sf_search

References

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_search_parameterized.htm#resources_search_parameterized

Examples

## Not run: 
# free text search only on Contact record Phone fields
# this will improve the performance of the search
my_phone_search <- "(336)"
search_result <- sf_search(my_phone_search,
                           objects = c("Contact", "Lead"),
                           fields_scope = "PHONE",
                           fields = c("Id", "FirstName", "LastName"))

## End(Not run)

salesforcer documentation built on March 18, 2022, 6:26 p.m.