searchAndScreenPop() for Salesforce Classic

Searches objects specified in the softphone layout for a given string. Returns search results and screen pops any matching records. This method respects screen pop settings defined in the softphone layout.

The returned response displays only matches that meet your softphone layout settings. However, the search page that screen pops, displays all matches, regardless of the objects you specify in your sofpthone layout.

NameTypeDescription
searchParamsstringString to search.
queryParamsstringSpecifies the query parameters to pass to the URL.
callTypestringSpecifies the type of call—inbound, outbound, internal, or null. Per the settings in the softphone layout, the call type determines which objects to search for any matches. If callType is null, searches are inbound by default. If callType is internal or outbound, no screen pops occur.
callbackfunctionJavaScript method executed when the API method call is completed.
NameTypeDescription
resultstringReturns a list of objects that match the search results. The search is performed on the objects specified in the softphone layout. For each object found, the object ID, field names, field values, and for API version 33.0 or later, object tab names are returned as a JSON string. If multiple matches are found, only a single field is returned. For API version 31.0 and later, invoking this method on a PersonAccount object returns additional contactId and personAccount fields.
errorstringIf the API call was successful, this variable is undefined. If the API call failed, this variable returns an error message.

Example result when searching for “Acme” (one Account and three Opportunity objects found):

Example result for a PersonAccount object (API version 31.0 and later):