From Bright Pattern Documentation

Revision as of 20:10, 2 April 2026 by Laura.donovan (talk | contribs) (Updated via BpClonePage extension. Source page: draft:AgentDesktop-client-side-javascript-api-specification/onRequestRecordInfo)

< Previous | Next >
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

onRequestRecordInfo

This callback is used when you want to show a screen pop from a Bright Pattern scenario. If your integration doesn’t use screen pop from scenarios, there is no need to implement it. This callback helps to fetch display data for the ID received from a scenario in order to correctly display it in the Communicator Widget UI.

Request

Syntax

on('ON_REQUEST_RECORD_INFO', handler: OnRequestRecordInfoHandler): void

type OnRequestRecordInfoHandler = (payload: RecordInfoRequest) => SyncAsyncResult<InteractionAssociatedObjectData | null>

type RecordInfoRequest = {

   id: string
   type: string

}

type InteractionAssociatedObjectData = {

   id: string
   type: string
   displayName: string
   displayType: string
   customFields: Record<string, string>

}

Parameters

Parameter Parameter Values Data Type Optional/Required Description
RecordInfoRequest object Required Request data
id string Required ID of the record
type string Required Type of the record


Example Request

    adApi.on("ON_REQUEST_RECORD_INFO", payload => {

        return crmApi.getRecord(payload.id, payload.type).then(result => {

            return {

                id: result.get("sys_id"),

                type: result.get("sys_type"),

                displayName: result.get("description"),

                displayType: result.get("sys_type"),

                customFields: {},

            }

        )

    })

Return Value

Object Object Values Data Type Optional? (Y/N) Value Description
InteractionAssociatedObjectData object or null Info about requested object. null if object is not found.
id string Record's unique ID
type string Type of the record (contact, case, task, etc.)
displayName string Display name of the record
displayType string Display type the record
customFields object Any additional information about the record
< Previous | Next >