- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2016 10:45 PM
HI,
Can you please suggest how to remove edit buton for only 1 record producer.
For this I am trying on load client script as follow, but it is not working can any suggest on this.
function onLoad() {
document.getElementById('header_add_attachment').style.display = 'none';
}
And I need to give "Add attachments" link/button on middle of form and when I click that link/button it shouls be able to upload 1 file and save it in "ATTACHMENTS" table.
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2016 11:03 PM
Hi Radhika,
It should be
function onLoad() {
g_form.disableAttachments()
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2016 11:08 PM
Hi Pradeep & Harsh,
Both worked thanks a lot for both 🙂
Any idea that Ican keep a link/button in middle of form and save that attchment in "attachment" table

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2016 11:11 PM
Thanks Radhika for the update.
Please refer below link on how you can add attachment as button. However please make sure that your client script doesn't conflict with this.
Create a custom attachment button for your service catalog
Adding attachment button to service catalog request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2016 11:29 PM
Worked thanks a lot

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2016 11:31 PM
Awesome.
Would you marking response as correct and close the loop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2016 12:03 AM
function onSubmit() {
//var cat_id = gel('sysparm_item_guid').value; g_form.getParameter("sysparm_item_guid")
var cat_id =g_form.getParameter("sysparm_item_guid");
var gr = new GlideRecord("sys_attachment");
gr.addQuery("table_name", "u_supporting_document_submission_request");
gr.addQuery("table_sys_id", cat_id);
gr.query();
if (!gr.next()) {
alert("You must attach a file to submit.");
return false;
}
}
Hi pradeep,
I have written this code for onsubmit to do attachment mandatory, but after have choosen attachment also aert is remaining same.it is not going to submit the form.