To make additional comments mandatory when state set to canceled (should run in both views)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 07:41 AM
Dear Team,
In the Incident record, when the field State is set to 'Canceled', then want to make the field 'Additional Comments (comments)' mandatory and restrict the form submission/updation/save and throw an error message at top.
This should work in both views (Portal view and Standard form view)
I tried through client scripts, UI Policies but no luck.
Kindly help with the steps and script to get this resolved.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 07:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 07:50 AM
Something similar to
https://www.servicenow.com/community/developer-forum/make-field-mandatory-using-client-script/m-p/15...
and through UI Policy also make field mandatory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 07:57 AM
Hi @rishabh31 ,
Thanks for sharing the info. Hope u kept the UI type as ALL in both scenarios. The steps for creating either a UI policy or Client script will be pretty straight forward.
In ur UI type u can keep condition such as
State Changes to Cancelled
N under UI Policy Action create a new entry stating Comments mandatory true visible true.
Try keeping the Order of the UI policy to some Odd number so that it does not collide with any other UI policy.
Same goes with Client script as well
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 08:08 AM
I have created something same as told by you but not working properly as it allows to save/update/submit the particular incident record.
O/P