Lock down change states for users with change_management role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 05:07 AM
Hi,
I am looking to lock down certain states available for selection within the change state field. Please see below options;
I would like for 'ITIL' users to only be able to select the following states;
Draft
Review
Closed
Users with the change_management role should be able to select any of the above states.
Any help with this would be greatly appreciate.d
Kind regards,
Emma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 06:39 AM
if(g_user.hasRole('itil') && !(g_user.hasRole('change_management')) && g_form.getValue('type')== 'Norma')
{//add all states that you want to remove
g_form.removeOption('state','approved')
g_form.removeOption('state','schedules')
//Others
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 06:42 AM
if(g_form.getValue('type')=='normal') //adding condition for type
{
if(g_user.hasRole('itil') && !(g_user.hasRole('change_management')))
{//add all states that you want to remove
g_form.removeOption('state','approved')
g_form.removeOption('state','schedules')
//Others
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 06:48 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 06:50 AM
Write the script at the time of onload clientscript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 06:51 AM
Hi Emma,
For any client side script change (client scripts / ui policies/ Ui Actions) , changes will be reflected only after the form is loaded, you dont necessarily have to save the record, just reload the window and you will see the changes.