The button should be able to show the popup with phone number of the incident's caller

nivethika
Tera Contributor

Hi Team,

 

I have a requirement that there should be one button in Service Operation Workspace - incident form. When the user clicks the button there should be popup with caller's phone number. It should be clickable. 

 

Any help would be appreciated & helpful.

 

Thanks in Advance,

Nivethika

1 ACCEPTED SOLUTION

hi @nivethika 

Try bellow:

- create a new UI Action.

- Fill in the following fields:

 

  • Name: Call
  • Table: Incident [incident]
  • Condition: current.caller_id.isValid() (ensures the caller is set)
  • Action name: show_caller_phone
  • Show in list: false
  • Show in form: true
  • Client: true

 

function showCallerPhone() {
    var callerPhone = current.caller_id.phone; // Fetch the caller's phone number
    if (callerPhone) {
        var html = '<a href="tel:' + callerPhone + '">' + callerPhone + '</a>';
        var dialog = new GlideModal('Caller Phone');
        dialog.setBody(html, false);
        dialog.setTitle('Caller Phone Number');
        dialog.render();
    } else {
        alert("No phone number found for the caller.");
    }
}

// Call the function when the button is clicked
showCallerPhone();

 

 

View solution in original post

10 REPLIES 10

Try changing the browser once, sometimes it happens.

 

Also have one check if above anything not works, create simple UI action and check that working or not.