Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to Make field mandatory with business rule and UI action ?

RudhraKAM
Tera Guru

HI , I have a requirement to make due date mandatory when state changes to submitted , I am trying to implement this with Business rule and UI action , can you please help me with this 

Business rule: what should i write in advance script ?

find_real_file.png 

UI action : up on clicking the UI action the due date will be mandatory and if due date is provided then it should submit and change state to submitted.

find_real_file.png

1 ACCEPTED SOLUTION

Hi kam,

Unfortunately there is no way to make a field mandatory through BR. 

But you can do so through UI Actions and Data Policies (or only Data Polices)

So your UI action requires some minor changes - 

find_real_file.png

So if you want to make a UI Action with Client - checked then you would have to do something similar as I did to run both client and server script. 
As you can see on line 2, I was initially set the assigned to mandatory but that wont be required as well if you use Data Policy. 

find_real_file.png

This will ensure that in anyway whenever the state changes to In-progress (for mine example) the Assigned To will be made mandatory. 

 

So you can use both in combination - UI Action and Data Policy or Just the Data Policy. Unfortunately there is no BR method to implement the same. 

 

Cheers,

Sam 

View solution in original post

5 REPLIES 5

Sam Dey1
Kilo Guru

Hi kam,

To make a field mandatory the best solution would be implement - UI Policies and Data Policies. 

UI Policies - work on client/browser level

Data Policies - work on the Server level

 

So you can make a UI Policy - where condition would be same as the condition you were setting up in BR and UI Action, i.e. - State Changes to Submitted

Then inside the UI Policy you would get a related list to create a UI POlicy Action 

Click on "New"

and select "Due Date" - Mandatory Column to True.

 

Same goes for Data Policy.

 

That should work. 

 

Cheers,

Sam

This is a special requirement long story short we need br and UI action to make it mandatory 

Hi kam,

Unfortunately there is no way to make a field mandatory through BR. 

But you can do so through UI Actions and Data Policies (or only Data Polices)

So your UI action requires some minor changes - 

find_real_file.png

So if you want to make a UI Action with Client - checked then you would have to do something similar as I did to run both client and server script. 
As you can see on line 2, I was initially set the assigned to mandatory but that wont be required as well if you use Data Policy. 

find_real_file.png

This will ensure that in anyway whenever the state changes to In-progress (for mine example) the Assigned To will be made mandatory. 

 

So you can use both in combination - UI Action and Data Policy or Just the Data Policy. Unfortunately there is no BR method to implement the same. 

 

Cheers,

Sam 

You can "enforce the population" of a field via Business Rules, but you cannot make it mandatory, ie preventing the user from leaving the UI via a Business Rule.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022