- 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-25-2024 01:25 AM - edited 09-25-2024 05:41 AM
Yes i tried making false for those fields, after that button is not visible in the record. My button name is call. I checked there is phone number added in phone field as well in mobile_phone field in user table
Kindly do let me know where i need to correct.
But it is working in incident form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 12:13 AM
Hi @Rajesh Chopade1 ,
Thank you so much for your information.
I am awaiting for your further updates and instructions in this regard.
Thanks & Regards,
Nivethika
- 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-26-2024 04:12 AM
Thanks a lot @Rajesh Chopade1 .
This too didn't work inside SOW incident form,
UI Action is not executing for SOW. Any specific settings have to do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 04:19 AM
This might be having many reasons, you can have following checks:
Look at the browser's console for any JavaScript errors. Open the Developer Tools (usually F12) and check the Console tab. Any errors here could indicate what’s going wrong.
Ensure that the condition for the UI Action is correct and evaluates to true when you expect it to execute.
Check the roles assigned to the user attempting to execute the UI Action. Ensure that they have the necessary roles to execute it.
Add logs (gs.log) and check where the script is failing