how to restrict list view edit of state of change records?

sai190
Tera Contributor

hi,

I want to restrict edit of state fields for list view  where only change manager role needs to be able to see closed successful and closed with defects options in state, even the admin should not see these two options, rest of the options of the state field can be editable by anyone.

can anyone help me with this?

 

in the form view i have written a code for hide on form view but unable to do it on list view?

 

function onLoad() {
   
    var flag = g_user.hasRole('change_manager');
    if(flag != true ||  g_user.hasRole('admin'))
        {
            g_form.removeOption('state', '3');
            g_form.removeOption('state', '14');            
        }  
}

20 REPLIES 20

it will check that user should not have admin role.


***Mark Correct or Helpful if it helps.***