Script to inactivate the attachment icon on change requests.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 01:05 PM
Hello,
I have a client script below that inactivates the attachment icon on change requests when it is in a state other than "New". However, I missed a step, I want users who are members of the "GPI- Change Management Office" group to be able to attach icons to change requests regardless of the state the request is in, but I am not sure how to do this. Thank you for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 06:45 PM
check the backend value of 'New' in state field i.e for New its -1 in OOB.
function onLoad() {
var current_state = g_form.getValue('state');
if (current_state != '1') { // in my instance backend value for 'New' is 1
g_form.disableAttachments();
}
}
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Thanks
Krishnamohan