Change - Restrict ability to remove attachments after approval.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2017 03:47 AM
Hi all,
Can we restrict ability to remove attachment after changes are approved for Normal and Emergency Change Requests at Scheduled/Implement/Review/Closed States.
Please can any one suggest me other than acl.
Thanks,
Sindhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2023 08:46 AM
Hi,
//Hide attachment Icon when state is scheduled/Implement/review but not for user has role admins and Change Manager
I tried onload client script its working as expected
function onLoad() {
var state = g_form.getValue('state');
var loggeduser = g_user.userID;
if ((state == '-2' || state == '-1' || state == '0') && (!g_user.hasRole('admin')) && (!g_user.hasRole('change_manager'))) {
g_form.disableAttachments();
} else {
g_form.enableAttachments();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2023 06:55 AM
Ignore the above one
tried another OnLoad client script
See below
function onLoad() {
//Type appropriate comment here, and begin script below
var state = g_form.getValue('state');
if(state == '-2' || state == '-1' || state == '0'|| state == '3') //scheduled/Implement/review/Closed
//please change this if condition to
//if you want the attachment icon to be available in either admin or change_manager
if(g_user.hasRole('admin') || g_user.hasRole('change_manager'))
// the below code requires the user to be both admin and change_manager
//if(g_user.hasRole('admin') && g_user.hasRole('change_manager'))
g_form.enableAttachments();
else
g_form.disableAttachments();
}
Thanks,
Lakshmi...