How to use searchAndScreenPop() for Case Search in Salesforce Open CTI?

How to use searchAndScreenPop() for Case Search in Salesforce Open CTI?

sforce.opencti.searchAndScreenPop() method is used to search records from the objects selected in the softphone layout for a given string.

Sample code with Case Number search:
sforce.opencti.searchAndScreenPop( {
    searchParams : “300002365” ,
    queryParams : ”,
    callType : “inbound”,
    deferred:true,
    callback: function( result ) { console.log( ‘Result is ‘ + JSON.stringify( result ) ) }
} );

Here, 300002365 is the Case Number to search the Case Record.


Sample code with Case Subject search:
sforce.opencti.searchAndScreenPop( {
    searchParams : “Test Subject” ,
    queryParams : ”,
    callType : “inbound”,
    deferred:true, callback: function( result ) { console.log( ‘Result is ‘ + JSON.stringify( result ) ) }
} );

Here “Test Subject” is the Subject of the Case record to search.
Note:
1.  If the screen pop is not working or not searching the records from the objects selected in the softphone layout, please try in incognito mode.
2. Many times, clearing cache and cookies helps you to test the changes. Testing within few minutes after the changes in the softphone layout should be avoided. If you want to test instantly, use Incognito Mode or clear browser cookies and cache.

Leave a Reply