- 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-04-2016 11:37 AM
Hello Dasthagiri,
I tried that piece of code as well. Unfortunately that did not work as well.
- 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: