- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 06:29 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 03:20 AM
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();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 07:38 AM
This already exists. There is a field info icon in the caller field that will open the record in a new tab. Why reinvent the wheel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 07:57 AM
Hi @nivethika
What @Brian Lancaster suggested is OOB and recommended, but if you having specific requirement then you can achieve this by using UI Action.
- Set the Condition to show the button only in specific contexts, such as when the user is in the Workspace or based on the incident state. You can check for workspace-specific roles.
- Providing bellow sample script, do required changes as per your requirement:
// Open a modal dialog showing the caller's phone number
function showPhoneNumber() {
var callerPhone = g_form.getValue('caller_id.phone'); // Get the phone number from the caller field
if (callerPhone) {
// Use a modal dialog to display the phone number
var dialog = new GlideDialogWindow('glide_confirm_basic');
dialog.setTitle('Caller Phone Number');
dialog.setPreference('title', 'Caller Phone Number');
dialog.setPreference('question', '<a href="tel:' + callerPhone + '">' + callerPhone + '</a>'); // Clickable phone number
dialog.setPreference('button_label', 'Close');
dialog.render();
} else {
alert('No phone number available for the caller.');
}
}
i hope my answer helps you to resolve your issue, if yes please mark my answer helpful and correct.
thank you
rajesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2024 12:04 AM
Thank you so much @Rajesh Chopade1 for sharing the information.
I tried with this code but it is not working. Please help me to achieve it. Below attached my screen shot for your reference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2024 01:13 AM
hi @nivethika
please do following changes
- Show Insert: False
- Show Update: False
and make sure caller's phone number is not blank in user table.