Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Mandatory Field not Mandatory!

Cirrus
Kilo Sage

All,

This should be easy, shouldn't it? Using UI Policies, when a call comes into ServiceDesk, they can select a call type. For one particular call type (X), they then select a sub-type which is a mandatory selection. If that sub-type selection is 'Y' then a new true/false field called Terms and Conditions (u_tc) will appear. We want u_tc field to be mandatory also, but when I create a new policy which is applied when Type = X and Sub-Type = Y, with the UI action set as u_tc mandatory = true, visible = true, the user can still complete the ticket without checking u_tc. 

I have even tried an On Load client script (removing the mandatory = true portion above so that the field still appears):

function onLoad() {
//Type appropriate comment here, and begin script below
if(g_form.getValue('y') == value)
g_form.setMandatory('u_tc', true);
}

What am I doing wrong here?

1 ACCEPTED SOLUTION

You can't make True/False field mandatory using UI policy

You have to either write an onSubmit client script or change to field choice type with Yes/No values

Below links might be helpful

https://community.servicenow.com/community?id=community_question&sys_id=0fbec761dbdcdbc01dcaf3231f961950

https://community.servicenow.com/community?id=community_question&sys_id=1e83ce61dbe85bc00e3dfb651f9619d9

View solution in original post

8 REPLIES 8

Cirrus
Kilo Sage

Thanks GGG. This is how I have it currently and still the field is not mandatory. I am sure its to do with it being a true/false field

You can't make True/False field mandatory using UI policy

You have to either write an onSubmit client script or change to field choice type with Yes/No values

Below links might be helpful

https://community.servicenow.com/community?id=community_question&sys_id=0fbec761dbdcdbc01dcaf3231f961950

https://community.servicenow.com/community?id=community_question&sys_id=1e83ce61dbe85bc00e3dfb651f9619d9

correct. if the field is false it HAS a value: FALSE.

you CANT make a true false field mandatory.

change it to a drop down with Yes / No as the selections.

 

Cirrus
Kilo Sage

Thanks everyone, I have written an on submit client script that alerts the user if the yes/no field is not checked