Making Variables editable on Catalog Task Form

Angshuman3
Mega Guru

Hi All,

Is it possible to to make variables editable on catalog task form based on user roles by using Client Script??...

The requirement is some variables should be editable for ITIL users 

Can someone help me with this?

Thanks and Regards,
Angshuman

1 ACCEPTED SOLUTION

Bhawana Upreti
Tera Guru

Yes, It is possible. You can write a client script like if user has role set field to writable else readable.

      var rqdrole = g_user.hasRole('RoleName');

       if (rqdrole){

              g_form.setReadonly('fieldname',false);

       }

Hope this helps.

Thanks.

   

View solution in original post

18 REPLIES 18

Bhawana Upreti
Tera Guru

Yes, It is possible. You can write a client script like if user has role set field to writable else readable.

      var rqdrole = g_user.hasRole('RoleName');

       if (rqdrole){

              g_form.setReadonly('fieldname',false);

       }

Hope this helps.

Thanks.

   

Hi,

Thanks for the information. Will the same work if I want it in the variables??....
Like I want some variables to be editable for ITIL users in Catalog task form..

Thanks,
Angshuman

Yes, you can also use UI policy to achieve the same.

 

Thanks.

Hi,

I have tried using UI policy both using Run Script and normal UI Policy action, its not working and I am not sure if dot walking is allowed in UI Policy as I used "g_form.setReadonly('variables.variable_name',false)" .

I have also tried the following client script in Catalog Task table :-

function onLoad(){
   if (g_user.hasRole('itil')){

      g_form.setReadonly('fieldname',false);

   }
}

it still didn't work..... 😞

In the RITM form for the same catalog item all the variables are editable for Admin but Read-Only for ITIL users. But, in Catalog Task form it is required editable for both Admin and ITIL users. It is already editable for Admin but for the ITIL users its the same as in RITM Form.

Thanks,
Angshuman