Making a single Catalog Item Variable Mandatory when SCTASK is closed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2019 12:21 PM
HELP!
I want to make a single Catalog Item Variable mandatory only when I try to close the SCTASK.
Since it's only on one Item, I don't want to make a global change in the "Close SCTACK" UI actions.
I think the "Catalog UI Policy" definition is the way to go here.
Variable name is "active_directory_user_id".
My Catalog conditions are when "activity_directory_user_id" is empty and only applied to Catalog Tasks.
The script looks like this:
UI Type: Desktop
Execute if true:
function onCondition() {
var ritm= g_form.getReferenec("request_item");
if((g_form.getValue('state')==3) && (ritm.cat_item=='6c680c8c1b98b300c7ad8622dd4bcb88'))
if(g_form.getValue('variables.active_directory_user_id')=='')
g_form.setMandatory('variables.active_directory_user_id',true);
return false;
}
What else to I need to do to get this to work?
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2019 10:26 AM
Spark106,
I'm not sure I'm doing the Catalog Client Script right.
This is what I have, but it won't compile correctly:
function onSubmit() {
var state = g_form.getValue('state');
if(state == '3') and g_scratchpad.wf_activity == 'Configure Active Directory';
then g_form.setMandatory('variables.active_directory_user_id',true);
}