To restrict attachment on incident from, once state is closed or resolved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 01:59 AM
Hi All,
I want to restrict users from attaching files on incident form, once incident is closed or resolved.
Kindly provide your input on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 02:10 AM
Hello Pratik,
Though it is not preferred to use DOM manipulation, you can try something like this in onload client script.
document.getElementById('header_add_attachment').style.display='none';
Check in the script if incident is closed or resolved.
Hope this helps.
Thanks,
Jotiram

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 02:13 AM
Hi Pratik,
You can create the client script to hide or disable the attachment option when incident state is closed is resolved as per your requirement. Below is the script for the same to hide when state is closed:
function onLoad() {
if (g_form.getValue('incident_state') == '7')
g_form.disableAttachments();
}
Regards,
Anjali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 02:25 AM
Hi
Thanks for your response.
I don't want to hide attachment icon.
Is there any other option, so we alert error message as "Incident is close, so you can;t add attachment"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 02:13 AM
Hi Pratik,
You can write an onload client script to validate the state and add this code
if(g_form.getValue('state') == 3 || g_form.getValue('state') == 6){
g_form.disableAttachments();
}
3 - Closed
6 - Resolved
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response