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

Musab Rasheed
Tera Sage
Tera Sage

Hello,

You can do this with UI policy , did you create UI policy ?

Regards

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

Hi ,

Thanks for the reply!

yes I did create UI policy but with this the state first changes to "Assess" and then making field mandatory, but I want these fields to be filled already only then the state should be allowed to change to "Assess" from new.

It is like when I click the "Assess" button, if these fields are empty, it should set these as mandatory.

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

Yousaf
Giga Sage

Hi

I think the more secure option would be to use ACL.

Restrict access to certain field when state is Assess.


Mark Correct ro Helpful if it helps.


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