Check Box Field enable for particular catalog task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 02:14 AM
Hi Team ,
We have requirement that
We have catalog called " ABC GXC " , for this catalog , 2 catalog task will trigger ,
our requirment is
we need a check box field only for 2 nd SCTASK , when 2nd SCTASK state changes to Closed completed , that check field should be mandatory .
how to achieve this requirment .
Please provide us steps and screenshots for better understanding .
Thanks in advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 02:53 AM
Hi @nameisnani The UI Policy needs to be on your "ABC GXC" catalog item. Go to that catalog item create a variable and then UI policy to hide
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 02:58 AM
Hi @Harish KM
I think u are not clear about my requirement .
The check Box field only for 2nd SCTASK , i mean like this
what will be use creating new variable in catalog item ,
it has to be create only in sctask . i hope u have got clear idea

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 03:06 AM
Hi @nameisnani oops sry I tot itz a variable. If it is field no UI Policy required. Just on Submit client script will do. This script will run when you hit close task UI Button and make field mandatory.
Script:
function onSubmit() {
var action = g_form.getActionName();// get action name of Close Task UI Action
var shortDesc = g_form.getValue("short_description"); // get value of 2nd task short description
var stateVal = g_form.getValue("state"); // get close complete state value
if (action == "close_sc_task" && shortDesc == "Task Short Description" && stateVal == 3) {
g_form.setMandatory("fieldname", true); // set variable mandatory
return false;
}
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 02:56 AM
you can create normal onChange client script on sc_task and on State field
Determine the short description and see if it is for 2nd task if yes then make the checkbox field mandatory when state is close complete
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader