searchAndGetScreenPopUrl() for Salesforce Classic

Searches objects specified in the softphone layout for a given string. Returns search results and the relative URL to be screen popped. Note that this method does not perform an actual screen pop. This method respects screen pop settings defined in the softphone layout. This method is only available in API version 28.0 or later.

This method is not available in the Open CTI API for Lightning Experience. To accomplish the same functionality in Lightning, use the deferred parameter available in the searchAndScreenPop() for Lightning Experience method.

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 and the URL to the screen pop (screenPopUrl). 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 name are returned as a JSON string. 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):