setReadOnly is not working in service portal for reference field

mubeenam
Kilo Expert

setReadOnly is not working in service portal for reference field(catalog client script)

1 ACCEPTED SOLUTION

mubeenam
Kilo Expert

We had restrict the users based on roles so UI policy is not the flexible , i have 1 more policy on same field.



I got solution for this . they have changed syntax bit



g_form.setReadOnly('variable name', value);


ex: g_form.setReadonly('requested_by', true);


View solution in original post

4 REPLIES 4

amlanpal
Kilo Sage

Hi Mubeena,



Please make sure the UI Type field in the Catalog Client Script is set to All. Please check: Re: catalog client script on Service Portal don't working



I hope this helps.Please mark correct/helpful based on impact


i have clicked on both option on UI type


find_real_file.png


Vladi1
Kilo Guru

You can use catalog UI policy without defining catalog condition and check all boxes under "advanced view/when to apply"


Visible = true


Read Only = true


Mandatory = leave alone


mubeenam
Kilo Expert

We had restrict the users based on roles so UI policy is not the flexible , i have 1 more policy on same field.



I got solution for this . they have changed syntax bit



g_form.setReadOnly('variable name', value);


ex: g_form.setReadonly('requested_by', true);