Override Mandatory on draft state

Gary Larsen
Mega Sage

I have several mandatory fields on change request, and I need to allow save as draft without all of them filled 

1 ACCEPTED SOLUTION

jaheerhattiwale
Mega Sage
Mega Sage

@Gary Larsen Create a new UI Policy

 

Set the filter as State = Drfat

jaheerhattiwale_0-1670408069102.png

 

Write in "Execute if true" script : g_form.checkMandatory = false;

Write in "Execute if false" script : g_form.checkMandatory = true;

 

jaheerhattiwale_1-1670408158325.png

 

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

View solution in original post

7 REPLIES 7

Mike_R
Kilo Patron
Kilo Patron

You can create a "save draft" UI action to allow them to save without entering the mandatory fields. We'll need to code it to ignore the mandatory fields.

 

But a better approach is to just configure your form so that the fields do not become mandatory until you move the change to the next state (such as assess)

Manuel Stimac
Mega Sage

Hi @Gary Larsen,

I would create an on before Business Rule in that specific case. For example:
When to run:

ManuelStimac_0-1670256905344.png

 

Actions:

ManuelStimac_1-1670256968212.png

 

If this answer helps you please mark it as Helpful/Solution.
Thanks & Regards - Manuel 

 


If my answer helped you, please mark it as Helpful/Solution.
Thanks & many Regards - Manuel 

not following how that would help me save the change as draft without having all of the mandatory fields filled 

Hi @Gary Larsen,

I was following up with the idea to disable the mandatory fields first. The Business rule would ensure on a certain state change that the fields must be filled. With this you could save it like a draft but also ensure that the field will be filled at a certain stage in your process.

 

If this answer helps you please mark it as Helpful/Solution.
Thanks & Regards - Manuel 

 


If my answer helped you, please mark it as Helpful/Solution.
Thanks & many Regards - Manuel