Hide email client icon for non itil users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2011 08:47 AM
Hi all ServiceNow guys,
I used the script mentioned on the wiki page to hide the email client icon for non itil user but I detected an undesired impact.
function onLoad() { removeEmailIcon(); function removeEmailIcon() { var yesRole = g_user.hasRoles(); if (!yesRole) { var refs = document.getElementsByTagName("a"); if (refs) { for (var i=0; i < refs.length; i++) { var ref = refs<i>; var inner = ref.innerHTML; if (inner.indexOf("email.gifx") > 0){ ref.style.display = 'none'; } } } } } }
On my task form, i add a custom glide_list field named "Additional contact" equivalent with the "Watch List" field but used only for non itil user. This field have also the same icon named "email.gifx" as the email client.
I you understand the problem ... the script used to hide the email client icon, hide the email icon of the "additional contact" field too.
Do you have an idea to avoid this problem ?
Regards,
Smarti37.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 10:47 AM
Hi Paul,
The scoped application might be what is blocking prototype. Give this a read:
Scoped Applications and Client Scripts: A Primer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 11:26 AM
There is a system property that you can enable, described in that article, that will allow prototype access in a scoped script. Give that a try.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2015 11:13 AM
Hi Paul,
Can you please update me on whether or not you had a chance to read that link I sent? That will fix your issue. Issue is the prototype library was not being loaded. That article has the resolution.
Thank you
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2015 11:15 AM
Hi Ben,
I was able to try it and it worked as expected. Thanks a lot for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2012 09:12 PM
What does "$('email_client_open').hide();" do ?