- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2022 06:09 AM
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!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2022 12:36 AM
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
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2022 07:03 AM
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.***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2022 08:16 PM
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 )

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2022 04:20 AM
No Problem.
Good that you found your answer.
***Mark Correct or Helpful if it helps.***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2023 02:04 PM
Which solution worked for you ?
1. UI POLICY ?
OR
2. UI ACTION ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2022 06:20 AM
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