Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to fix Error : The following mandatory fields are not filled in

Supriya25
Tera Guru

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 .

4 REPLIES 4

Vishal Birajdar
Giga Sage

Hi @Supriya25 

 

Can you provide screenshot of code snippet where you are making due date mandatory?

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Hi @Vishal Birajdar 

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;

}

varaprasad123
Kilo Guru

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.

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;

}