- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2021 07:10 AM
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2021 07:19 AM
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
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2021 07:19 AM
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
2022-25 ServiceNow Community MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2021 07:22 AM
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
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2021 12:19 AM
Actually I have done it through client scripts. Anyhow thank you so much.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2021 08:11 AM
Hi Jitu,
Hope you are doing well !
I would suggest to write On submit client script instead of business rule as Business rules are used for server scripting.
In on submit client script check mandatory fields is empty with help of g_form.getValue("field_database_name) == "" and set state value to Review with help of g_form.setValue("field_database_name", "database_value_of_review_state"). ServiceNow has out of box message for a field is mandatory or not.
Thanks & Regards,
Abdul
Please mark my response as correct & helpful so that this thread can be closed and others can be benefited by this.