screenPop() for Lightning Experience
Pops to a new location as specified by the input type and parameters. This method is available in API version 38.0 or later.
Open CTI for Lightning Experience doesn’t support the softphone layout field Screen pops open within when the value is New browser window or tab. In Lightning Experience, the default value is Existing browser window.
| Name | Type | Description |
|---|---|---|
type | string | Required. The screen pop target. Valid values:
|
params | object | Required. Arguments for the specified type value. See Type-Specific params Values. |
defaultFieldValues | object | Optional. Pre-populates fields on a new-entity screen pop when no search results exist for an inbound call. Only applies when type is NEW_RECORD_MODAL. See the sample code below for an example. |
callback | function | Optional. JavaScript method executed when the API call completes. |
The params argument takes different fields depending on the value of type.
SOBJECTWhere
recordIdis the ID of the standard or custom object in Salesforce.URLThe URL must be a relative path. For details on the
urlparameter, seeforce:navigateToURLin the Lightning Aura Components Developer Guide.OBJECTHOMEPops to the home page of an object such as a case or account. For details on the
scopeparameter, seeforce:navigateToSObjectin the Lightning Aura Components Developer Guide.Example:
{ scope: "Account" }LISTFor details on the
listViewIdandscopeparameters, seeforce:navigateToListin the Lightning Aura Components Developer Guide.SEARCHPops to the Top Results section of the search page. The string must be at least 3 characters.
NEW_RECORD_MODALentityNameis the API name of the object, such asAccount,Case,Contact, orLead.For custom objects, use the format
{objectName}__c(two underscores, default namespace).If your org has a namespace, use
namespace__{objectName}__c.To pop to a new person account modal, use
Account.FLOWPops to the target flow. Use
flowArgsto pass additional arguments such as the caller's phone number or a list of matching records.Only active UI screen flows of type
Flowcan be popped. Arguments inflowArgsmust be declared as variables inside the flow, or they are silently ignored at runtime. See the FlowVariable section in the topic on Flow in the Metadata API Developer Guide.
This method is asynchronous. The response is returned in an object passed to a callback method. The response object contains the following fields.
| Name | Type | Description |
|---|---|---|
success | boolean | Returns true if the API method call was invoked successfully, false otherwise. |
returnValue | object | This API method doesn’t return this object. The returnValue is always null. |
errors | array | If the API call was successful, this variable is null. If the API call failed, this variable returns an array of error messages. |