How to fix Error : The following mandatory fields are not filled in
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2023 04:22 PM - edited 09-11-2023 10:14 PM
Hi All,
Issue: When we click on "Resolve" button we are making one field "Due Date" Mandatory. Expect filling value in that mandatory field "Due Date", updated another fields values and clicked "SAVE" /"Update" instead of clicking on "Resolved" button.
why getting error like " The following mandatory fields are not filled in : Due Date " && still ""Due date" mandatory showing ???, Due Date should be Mandatory * only when click on "Resolve" button .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2023 06:34 PM
Hi @Supriya25
Can you provide screenshot of code snippet where you are making due date mandatory?
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2023 09:29 PM - edited 09-12-2023 05:52 AM
Any suggestions...?
we are using OnSubmit Client script to make field Mandatory when click on "Resolved", Exactly like below.
OnSubmit:
var action = g_form.getActionName();
if(action == 'resolved' ){
if(g_form.getValue('Due Date')==""){
g_form.setMandatory("Due Date", "true");
}
return false;
}
return true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2023 06:38 PM
hi @Supriya25 Can you share the code that you have in "Resolved" UI action, Or you can do a field watch and see if there are any other client scripts or UI policies that are making the field Mandatory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2023 08:27 PM - edited 09-12-2023 05:51 AM
Hi, @varaprasad123
Any suggestions..?
we are using OnSubmit Client script to make field Mandatory when click on "Resolved", Exactly like below.
OnSubmit:
var action = g_form.getActionName();
if(action == 'resolved' ){
if(g_form.getValue('Due Date')==""){
g_form.setMandatory("Due Date", "true");
}
return false;
}
return true;
}