Set All fields Read only, once sc task is closed and saved only

Prasanna laksh1
Kilo Contributor

Hi All,

I wrote a UI  policy to make all fields read-only when the Catalog task state is completed. But while changing the state only all fields are getting read-only (refer attached print screens). As per the requirement after saving the form fields should become read-only. Please help me with this.

Thanks in advance!!

1 ACCEPTED SOLUTION

SumanthDosapati
Mega Sage
Mega Sage

Hi @Prasanna lakshmi Thota 

UI policy works onChange as well. 

So in your case, you need to deactivate that ui policy and write an onLoad client script as below

if(g_form.getValue('state') == '3') //check closed complete backend value once
{
var fields = g_form.getEditableFields();
for (var x = 0; x < fields.length; x++) {
    g_form.setReadOnly(fields[x], true);
}
}

 

Mark as correct and helpful if it solved your query.

Regards,
Sumanth

View solution in original post

5 REPLIES 5

@Prasanna lakshmi Thota , I first provided you solution without state condition which obviously you can easily add but you choose to like second solution. If you feel my response was enough to close the thread feel free to mark it as correct.

Take care.

Please hit like and mark my response as correct if that helps
Regards,
Musab