- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 07:07 AM
Hello community,
I'm kinda wondering why something like this is not enabled in Service Now by default.
The thing is, I've got a request from my customer that they want to disable the email client ('Compose email' UI action) hidden when a record is inactive.
I've already tried some approaches I found online and with the help of my colleagues but nothing really helped (adding a condition "current.active == 'true'" to the UI Action isn't working for me).
I checked this also in plain PDI and found out that by we cannot see the 'Compose email' UI action in incidents when the incident is inactive.
BUT
In all other tables where the email client is enabled, you can use it even when the record is inactive (RITM, SCTASK, CHG).
Have I missed something? Have you guys ever worked on something like this please? Could you maybe explain how this work and if it's even possible to conditionally disable the 'Compose email' UI action?
Thank you in advance!
mh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 07:13 AM
Hi @matej_h
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 07:26 AM
You can create an onLoad client script like this (on the tables where you want to hide it):
function onLoad() {
var active = g_form.getValue('active');
if(active == false) {
$('email_client_open').hide();
}
}
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 07:41 AM
When I adjust the script so it's retrieving 'State' value instead of 'Active,' it seems to be working. So the script would be
function onLoad() {
var ritmState = g_form.getValue('state');
if(ritmState == '3') { //3 is the value for Closed Complete (will add also value for Skipped and Incomplete)
$('email_client_open').hide();
}
}
So thank you very much for this, I didn't know about this $ function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 07:45 AM
Perfect and new learning.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************