- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2017 10:42 AM
making the field read only based on catalog task state
Solved! Go to Solution.
- Labels:
-
Best Practices
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2017 12:19 PM
You can write a client script on Task table onChange on field name State.
var catalogitem = g_form.getValue('u_item');
if(catalogitem=='Your catalog Item')
if(newValue==closedvalue && catalogitem=='Your Catalog Item')
{
g_form.seReadOnly('variables.Yourvariablename',true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2017 10:45 AM
you can use UI policy to set fields to read only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2017 10:48 AM
That thing I was aware , based on catalog task state ,I should make read only

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2017 11:28 AM
Hi Sandeep,
you need to write onChange() client script on your task table.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var statevalue=g_form.getValue('state');
if(statevalue==2)
{
g_form.setReadOnly('variables.test',true);
}
}
Please check the thread below.
Service Catalog UI Policy "Catalog Conditions" don't work
Thanks,
Harshvardhan
Hope this helps.Mark the answer as correct/helpful based on impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2017 11:38 AM
Actually I need to hide the few variables in RITM and Catalog task when the catalog state is closed complete so for RITM how I need to proceed ?