- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2022 08:37 AM
Hi,
Can you help me to make below particular variable read only when state is closed complete or closed incomplete or closed skipped. (screenshot attached)
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2022 04:55 AM
Hi
This can be done using a Client Script on Catalog Task Table. You just need to write an On Change Client Script on Catalog Task Table on State Field and use the script below:
This client script will take care of both scenario when state changes also after you save the form it will validate for the state value to make it read only.
Script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
var getState = g_form.getValue('state');
if (getState == 3 || getState == 4 || getState == 7) {
g_form.setReadOnly('variables.checkbox', true);
}
return;
}
if (newValue == 3 || newValue == 4 || newValue == 7) {
g_form.setReadOnly('variables.checkbox', true);
}
//Type appropriate comment here, and begin script below
}
Screenshot for reference:
Result:
Script is an tested one in my PDI and will work for you as well for the query mentioned.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2022 07:02 AM
Hi
Thanks! this actually worked as expected.
I have marked your response helpful and correct too.
Have a great year ahead!