- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2019 07:25 AM
Hi everyone,
We have one UI script which hides the 'attachment' icon in the email template of Incident form. The attachment icon and UI script written to hide it are shown below.
Is there any way to hide that attachment icon from RITM and sc_task table and keep it visible in only 'incident' table. Please help me with your insights. Thanks in advance.
- Navigate and open any incident form > Click on 'More Options' (3 dots)
- Click on 'Email template' icon
- In the template form, you will see the 'attachment' icon.
UI script written to hide that icon.
Is there any way that we can hide it only for Incident form/table? Please advise.
FYI, I am trying below code to incorporate the requirement, but it is not working
Regards,
Chaithra
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 07:26 AM
Hi Chaithra,
So you have reverted it to previous version and have not kept the code to get sysparm_table?
Are you running this in scoped app?
try this once instead of above code given by me
var gURL = new GlideURL();
gURL.setFromCurrent();
var tableName = gURL.getParam("sysparm_table");
if(tableName == 'sc_req_item' || tableName == 'sc_task'){
addLoadEvent(function() {
if (window.g_user == undefined) {
return;
}
try{
if(document.URL.indexOf('email_client.do') >= 0) {
$j(document).ready(function(){
$j('#attach_button').hide();
});
}
}
catch(e){
alert(e);
}
});
}
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2019 07:49 PM
Hi Chaithra,
Glad that it worked. Can you also mark my answer as correct and helpful.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2019 03:57 PM
Hi Ankur,
After implementing the above code, whatever we type in the navigation bar and click on any module.
For example, If we type 'Incident' and click on 'Incidents' or 'Create New', it is opening in a new window and this is happening everytime. Please advise whether it is related to tableName or anything?
Thanks,
Chaithra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2019 07:50 PM
Hi Chaithra,
I don't think it has anything to do with the above script. since that script will only run for email client.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2019 04:23 AM
Hi Ankur,
Okay, but reverting this script back to previous version fixed the above issue. Sp, I was just thinking is it something related to URL or decodeURI?
Regards,
Chaithra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2019 05:05 AM
Hi Chaithra,
But was it working for other tables after adding code for sc_req_item and sc_task?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader