
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2019 01:52 PM
We have a computer replacement request with the requirement that the fulfiller must check a box on a specific task (multiple choice field hidden on the REQ named “need_computer”). The task goes to a dispatch group who will reassign the task to a technician so it can’t be required unless the task is attempting to be closed.
I used the answer here:
and added this Catalog Client Script:
function onSubmit() { //Type appropriate comment here, and begin script below var ritm= g_form.getReferenec("request_item"); if((g_form.getValue('state')==3) && (ritm.cat_item=='3d131f3fdbec73004c1cd92b5e961928')){ if(g_form.getValue('variables.need_computer')==''){ g_form.setMandatory('variables.need_computer',true); return false; } } } |
However, I get this error when I attempt to close the task regardless if I select an option in “need_computer” or not:
Error MessageonSubmit script error: ReferenceError: 'func' is not defined: function () { saveAllSelected([ gel(id) ], [ gel(ref) ], ',', '\\', '--None--'); } |
Appreciate any help.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2019 01:02 PM
hit the wrong button.
I was able to get it working by moving the need_computer field to the sc_task table, then setting a system UI Policy to only show it on the one task, and another to make it mandatory on close. Then I added a workflow if script to route the ticket accordingly.
The problem was the fields I needed to base this on were not available through the request catalog ui policy.
Thank you for your assistance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2019 01:57 PM
Hi,
Why can't use a Catalog UI policy for this requirement .
Thanks,
pavan
Note : Please mark my answer correct / helpful so that servicenow will not wip out this question from the community .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2019 02:30 PM
That's what I started with. The problem is how do I have it only trigger on Closed Complete when I can't locate the state variable with the filters?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2019 07:26 AM
HI Brain,
you can see the variable names in the filter in the catalog ui policy and also you can write some conditions like when assignment group changes make it mandatory .
Please include the screen shots of the catalog ui policy ur trying to create.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2019 12:59 PM