Fields cannot be set to read-only in Catalog Task

ceraulo
Mega Guru

Hello!

We have a client script that sets all variables read-only in all Catalog Task.
I have a Catalog Item where the variable needs to be populated in the sctask and not in the catalog item view. I used a Catalog UI Policy to make the variable editable when the sctask is loaded. My issue is after the sctask is completed. The variables are still editable. The requirement is to make read-only after ticket closure. How to do this? I noticed that this issue applies only for select box fields.

Please help!

1 REPLY 1

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

Infact you should create a ACL on sc_task table to make it readonly once closed.

If you only want to make the variables readonly then write a onload script where it will check the state of the task and then make all variables readonly as below:

function onLoad() {

if(g_form.getValue('state') =='3')

 

{

 

  g_form.setVariablesReadOnly(true);

 

}

 

}


Thaks,
Ashutosh