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.

NameTypeDescription
typestringRequired. The screen pop target. Valid values:
  • SOBJECT
  • URL
  • OBJECTHOME
  • LIST
  • SEARCH
  • NEW_RECORD_MODAL
  • FLOW
paramsobjectRequired. Arguments for the specified type value. See Type-Specific params Values.
defaultFieldValuesobjectOptional. 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.
callbackfunctionOptional. JavaScript method executed when the API call completes.

The params argument takes different fields depending on the value of type.

SOBJECT

Where recordId is the ID of the standard or custom object in Salesforce.

URL

The URL must be a relative path. For details on the url parameter, see force:navigateToURL in the Lightning Aura Components Developer Guide.

OBJECTHOME

Pops to the home page of an object such as a case or account. For details on the scope parameter, see force:navigateToSObject in the Lightning Aura Components Developer Guide.

Example: { scope: "Account" }

LIST

For details on the listViewId and scope parameters, see force:navigateToList in the Lightning Aura Components Developer Guide.

SEARCH

Pops to the Top Results section of the search page. The string must be at least 3 characters.

NEW_RECORD_MODAL

entityName is the API name of the object, such as Account, Case, Contact, or Lead.

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.

FLOW

Pops to the target flow. Use flowArgs to pass additional arguments such as the caller's phone number or a list of matching records.

Only active UI screen flows of type Flow can be popped. Arguments in flowArgs must 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.

NameTypeDescription
successbooleanReturns true if the API method call was invoked successfully, false otherwise.
returnValueobjectThis API method doesn’t return this object. The returnValue is always null.
errorsarrayIf the API call was successful, this variable is null. If the API call failed, this variable returns an array of error messages.