make catalog task variables when state is closed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 11:06 PM
need to make catalog task variables read-only when the state field is closed. this should be applicable only for a particular catalog item.
I have written onchnage clien script as below. its not working as anticipated.
Kindly suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 11:27 PM
Hi @NiloferS ,
Please have a look at the below:
How to set the variables READ ONLY once the SCTASK is closed
Make Variables Field - Read Only in Catalog Task
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2024 12:17 AM
@NiloferS Please try the following script and see if it works for you.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var catalogitem = g_form.getDisplayBox('u_item').value;
if (catalogitem == 'Request for Approval and Documents') {
if (newValue == '3') {
g_form.setVariablesReadOnly(true);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2024 01:05 AM
Hi @NiloferS,
You can achieve mentioned requirement using UI policy.
Table : sc_task
Condition : Requested Item -> State is Closed Complete.
Attaching Screenshot for reference.
Please mark my response as correct and helpful if it helped solved your question.
Thanks,
Rohit Suryawanshi