How to create and open Case record in Salesforce using Open CTI?

How to create and open Case record in Salesforce using Open CTI?

sforce.opencti.saveLog() and sforce.opencti.screenPop() methods can be used to create and open Case record in Salesforce using Open CTI.

Sample Code:

sforce.opencti.saveLog( {
    value: { 
		entityApiName : "Case", 
		Subject : "Testing", 
		Priority : "Low",
		Origin : "Phone"
	},
    callback: function( result ) {
        console.log( 
			'Result is', 
			JSON.stringify( result ) 
		);
        console.log( 
			'Record Id is', 
			result.returnValue.recordId 
		);
        sforce.opencti.screenPop( {
            type : sforce.opencti.SCREENPOP_TYPE.SOBJECT,
            params : { 
				recordId : result.returnValue.recordId 
			},
            callback : function( result ) { 
				console.log( 
					'Result is',
					JSON.stringify( result ) 
				) 
			}
        } );
    }
} ); 

Leave a Reply