- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2016 07:35 PM
Hello Community,
I am trying to hide this item in the drop down list (its value is 3):
I tried to follow these links but they did not work for me:
Server-side script to hide values in incident state dropdown
How does one filter a field of type "workflow" based on the role of the logged in user?
I tried applying the code in the above forums here but it still appears.
- answer = true;
- // If has role and the choice is closed (value = 3)
- if (gs.hasRole('role here') && current.value == 3 && current.name == 'change_request' && current.element == 'state') {
- answer = false;
- }
When I tried flipping the code, it ended up hiding the entire "State" variable from the table which was not desired.
answer = false;
// If has role and the choice is closed (value = 3)
if (gs.hasRole('change_request_admin') && current.value == 3 && current.name == 'change_request' && current.element == 'state') {
answer = true;
}
Again, I only want to hide the "Closed Complete", from the "State" drop down list.
Any help would greatly be appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2016 06:53 PM
Hello Community,
I was able to get the piece of code working.
Here is the code that I used
function onChange() {
//Type appropriate comment here, and begin script below
var isCSAdmin = g_user.hasRole('change_request_admin');
var changestate = g_form.getValue('state');
if (!isCSAdmin){
g_form.removeOption('state', '3', 'Close Complete');
}
else{
if (isCSAdmin = true){
}
}
}
SS of procedure:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2016 09:59 PM
have you disabled the ACL which you have created before testing client script changes??
ACL which you wrote might be hiding that field.
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2016 11:36 AM
Hello Sushant,
Do I not need a security rule to perform this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2016 11:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2016 11:59 AM
Hello Erik,
How would one go about doing that? I am having some trouble applying these codes there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2016 10:26 PM
- answer = false;
- // If has role and the choice is closed (value = 3)
- if (gs.hasRole('change_request_admin') && current.state.value == 3 && current.name == 'change_request') {
- answer = true;
- }
- if u try like this
Regards,
Dasthagiri