- 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-15-2019 07:09 AM
Hi Ankur,
Yes, It was working for other tables after adding that code. But when we open any form or any application module from the navigation bar it was opening in a new tab and hence we reverted those changes back to previous code. Is there any way to fix those impacts? Please advise
Thanks,
Chaithra
- 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-16-2019 11:29 AM
Hi Ankur,
I have tried this in our instance and it workes perfectly fine. I don't see any impacts now. Thanks a lot for your help.
Regards,
Chaithra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2019 07:23 AM
Hi Ankur,
Can you please explain me what the below code does actually?
var gURL = new GlideURL();
gURL.setFromCurrent();
var tableName = gURL.getParam("sysparm_table");
Thanks in advance! 🙂
Regards,
Chaithra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2019 07:39 AM
Hi Chaithra,
The script uses GlideURL class provided by ServiceNow and then uses getParm() function to get value of parameter present in the url
https://developer.servicenow.com/app.do#!/api_doc?v=london&id=r_GURL-GlideURL_S
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader