- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2014 05:02 AM
Hi,
I am trying to hide the attachment icon on header with below code in Eureka in an on load client script but it is not hiding the icon.
var attachment_header = document.getElementById('header_attachment_list');
attachment_header.style.display='none';
Any help or advise will be highly appreciated.
Sami.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2014 06:28 AM
Can you try hiding the attachment icon using below script
$$('img[title="Attachments..."]')[0].up().up().down().hide();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2016 10:25 AM
by default manipulating DOM objects is restricted for scoped applications.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2016 09:40 PM
Hi Verda,
you can try this to hide the attachment clip
document.getElementById('header_add_attachment').style.display = 'none';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2016 09:42 PM
you can try this as well
g_form.disableAttachments();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2016 12:30 PM
After long discussions with ServiceNow, here is what needs to be done to hide attachments (beyond disabling) in scoped apps:
1. Go to Access Control (ACL)
2. Go to sys_attachment
3. Operation read
4. Add the following at the top:
5. Add the testingACL function at the button and write your acl rules there.
if(current.table_name == 'your tablesname here"){
var gr = new GlideRecord('your tablesname here');
gr.get(current.table_sys_id);
gs.log('condition met');
answer = testingACL(gr);
}
else
answer = getAttachmentReadAnswer();
function getAttachmentReadAnswer() {
if (current.table_name.nil())
return true;
// If the attachment is from live feed,
// grant it the read access
if (current.table_name.indexOf("live_profile") > -1)
return true;
// Remove Prefix
var tableName = current.table_name;
var invisible_prefix = "ZZ_YY";
if (tableName.startsWith("ZZ_YY"))
tableName = tableName.substring(5);
var parentRecord = new GlideRecord(tableName);
parentRecord.setWorkflow(false);
if (!parentRecord.get(current.table_sys_id)) {
if (current.sys_created_by.equals(gs.getUserName()))
return true;
return false;
}
return parentRecord.canRead();
}
function testingACL(gr){
//add your rules here.....
}}}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2016 09:42 PM
you can try this as well
g_form.disableAttachments();