Quick Action generating a Script Evaluation Error when used in chat

Robert Crawley
Tera Expert

I'm working with Advanced Work Assignment and agent chat. We were asked to set up an on hold feature, which is working. I set up a boolean field on sys_cs_conversation, u_chat_on_hold that handles this with updates to the existing script include and scheduled jobs.

 

I'm working on building a quick action for this now, I'm only trying to pass a message to the current chat indicating the agent is placing the chat on a brief hold. I have it partially working at the moment, in that the agent is able to select the custom quick action and the message is sent to the current chat. However, I'm getting a Script Evaluation error after sending the quick action. I don't see the error referenced in the logs though. There is an "now-textarea.js:491 Uncaught TypeError: Cannot read properties of null (reading 'style')" in the console. It points to this: 

for (const entry of entries) {
entry.target.previousElementSibling.style.width = (it shows an x here in the console?)
entry.target.style.width;
entry.target.previousElementSibling.style.height =
entry.target.style.height;
}

 

This is the set up of my quick action:

Name: On Hold

Command: hold

Table: Interaction

Applies to: Type is Chat

Script: 

var message = "Thanks for your patience! I am going to place you on a brief hold while I look into this for you. I will be back shortly with an update.";
var success = success;

sn_connect.Conversation.get(record.channel_metadata_document, record.channel_metadata_table)
        .sendMessage({
            body: message,
            system: false
        });
answer = {
    success: true,
    message: message
};
 
Any idea what is causing the error? Once I get this working I plan on moving the message to a system property, and maybe updating the interaction to On Hold to help limit the agent's # of clicks.
0 REPLIES 0