UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hello Team,
I am new to the ServiceNow we have requirement that we have a drop down field "flag" (true or false) on the incident form if you click on the resolve button this field should become mandatory and show a pop message to fill the "flag" field without filling the "flag" field he/she can't resolve the incident can anyone help me in the ui action script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
38m ago
Hi @Shabbir1
You simply need to add your custom flag field to the Data Policy Rules of the existing data policy record.
URL: https://<instance-id>.service-now.com/sys_data_policy2.do?sys_id=d3efcfbf3bf2320050bec9bb34efc4c2
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4m ago - last edited 4m ago
- Navigate to System Definition > Client script
Create a Client Script:
- Type: onSubmit
- Table: incident
Script:function onSubmit() {
// Check if state is being set to Resolved //update state value as per your instance
if (g_form.getValue('state') == '6') {
var flag = g_form.getValue('u_flag'); // replace with your Flag field name
if (!flag) {
alert('Please mark the Flag checkBox before resolving the incident.');
g_form.setMandatory('u_flag', true);
return false;
}
}
}
