How do I make fields mandatory when state changes from New to Assess

Demo24
Tera Expert

Hi,

On the change request form we have the "State" field and this is a read-only field. We have an "Assess" UI action button which is the only way we can change state from "New" to "Assess". The requirement is that when status changes from New to Assess few of the fields need to be mandatory (say field1, field2). How to achieve this?

I am thinking of a way to use an UI policy and set these fields mandatory in all the other states except new state but I am just curious to know how to achieve it only when state changes from "New" to "Assess". I have also tried an onchange client script that sets fields as mandatory when old value is "-5" (new) and new value is "-4" (assess). This didn't work . Please help me in achieving this!

1 ACCEPTED SOLUTION

Then make it mandatory in UI action 'Assess', here is the link you can copy code and tweak accordingly

https://community.servicenow.com/community?id=community_question&sys_id=a323c3581b3dc110faf255fa234bcb78

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

View solution in original post

9 REPLIES 9

Hi 

I misunderstood earlier.

So you want to keep those fields non mandatory in new state? they will be only mandatory when Assess is clicked




***Mark Correct or Helpful if it helps.***

Hi ,

Sorry on replying late!

yes that is correct. only when "Assess" is clicked , they must be mandatory (in other words, state should not be allowed to change to assess if these fields are not filled in )

No Problem.

Good that you found your answer.


***Mark Correct or Helpful if it helps.***

Which solution worked for you ? 

1. UI POLICY ?

OR 

2. UI ACTION ?

Sagar Pagar
Tera Patron

Hi,

You hvae to create UI policy for this.

Condition as-

State ISONE OF select all states except New.

 

UI policy action -

Field1 -- mandatory as true

Field2 -- mandatory as true

 

Feel free to mark as helpful and correct!

Thanks,

Sagar Pagar

 

The world works with ServiceNow