- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-29-2022 06:50 AM
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!!
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-29-2022 06:59 AM
Hi
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-29-2022 08:32 AM
Take care.
Regards,
Musab