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

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

Sample Code:

sforce.opencti.saveLog( {
    value:{ entityApiName : "Task", Subject : "Testing", Priority : "Low" },
    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 ) ) }
        } );
    }
} );

Output:

Leave a Reply