SfNativeApi

SfNativeApi

new SfNativeApi()

contains native Salesforce methods available in Salesforce OpenCTI API.

Methods

runApex(params) → {Promise}

Executes an Apex method from an Apex class that’s exposed in Salesforce.

sfNativeApi.runApex({apexClass: "CaseHelper", methodName: "acceptCase", caseId=500A0000000flRF});
Parameters:
Name Type Description
params object

Parameters

Name Type Description
apexClass string

Specifies the Apex class of the method to execute.

methodName string

Specifies the method to execute

methodParams string

Specifies the method parameters to pass. The string must include field value pairs and be formatted as a valid query string.

Returns:
Type:
Promise

Promise represents result of the operation.

screenPop() → {Promise}

Screenpops Salesforce page

Please see Salesforce documentation for description of method parameters. The method returns promise with the result of execution so callback parameter is not used.

For Lighting mode: https://developer.salesforce.com/docs/atlas.en-us.api_cti.meta/api_cti/sforce_api_cti_screenpop_lex.htm

sfNativeApi.screenPop({type: 'sobject', params: {recordId: '500A0000000flRF'});

For Classic mode: https://developer.salesforce.com/docs/atlas.en-us.api_cti.meta/api_cti/sforce_api_cti_screenpop.htm Parameters are grouped in object

sfNativeApi.screenPop({url: '500A0000000flRF', force: true});
Returns:
Type:
Promise

Promise represents result of the operation.