business rule which checks all the fields mandatory are empty or not

Jitu Kumar
Tera Contributor

I want to write a business rule where the condition is:

Status is progress

In the script part I want to check whether the mandatory fields are empty or not. If empty it should show popup that "Please fill the mandatory fields" then update the mandatory fields manually and once the fields are filled manually after updating the status should change to Review.

Can anyone help me with the scripting part?

1 ACCEPTED SOLUTION

Voona Rohila
Tera Patron

You can write OnSubmit client script and make mandatory or check if values are filled or not if state is progress.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
5x ServiceNow MVP

View solution in original post

9 REPLIES 9

Voona Rohila
Tera Patron

You can write OnSubmit client script and make mandatory or check if values are filled or not if state is progress.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
5x ServiceNow MVP

Instead of clamoring for credit, perhaps actually answer the original question - can you use a business rule to require all mandatory fields be populated.  The method isMandatory only is of use on a form and there are many other ways clever users bypass constraints.  Data Policies offers some hope but lacks the changesTo that BRs offer.

Sincerely,

Ron Hoyt.

 

palanikumar
Giga Sage

Hi,

Your question is not clear. If you set a field mandatory then user cant submit the form. The BR will get executed only if the form is submitted.

For your requirement I suggest UI Policy. ServiceNow has a default way to highlight whether a field is mandatory or not. Do you want to use custom script?

Thank you,

Palani

Thank you,
Palani

Actually I have done it through client scripts. Anyhow thank you so much.