Make field mandatory in list view custom workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hello,
I make some of the fields mandatory in the dictionary level. It is validating while editing in the native view - list. but i tried clearing out that fields in the list view workspace and validation is not happening. It allowing me to clear the field.
Please help me here to configure fields to be mandatory in workspace list view also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi @DevadharshiG,
To achieve this, you have following options:
- Data Policies: Data policies can enforce mandatory fields on the server side. This ensures that the data is validated regardless of how it is entered (form, list, or through an integration). This is often the most robust solution.
- onCellEdit Client Script: You can create an onCellEdit client script. This type of client script is specifically designed to trigger when a user modifies a cell in a list view. Within the script, you can check if the field you want to be mandatory is being cleared and prevent the change if it is.
- UI Policy with 'List view' option: When creating a UI Policy, you can specify that it should apply to the list view. Ensure the "On cell edit" checkbox is ticked for the UI Policy. This will apply the policy's logic, including making fields mandatory, when a cell is edited in the list view.
Note: For your specific situation, creating a simple Data Policy that makes the desired field mandatory would be the most straightforward and reliable approach. If you require more complex, conditional logic for when a field should be mandatory in the list view, then an onCellEdit Client Script would be more appropriate.
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
you will require before update business rule OR data policy to check that
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @DevadharshiG ,
You can create On cell edit client script and make UI Type to all, then it will work as expected.
Thanks,
Pradeep
Regards,
Pradeep