- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2019 03:32 PM
Hello
We are on Madrid version. Wanted to find out if it is possible to display error message when user tries to remove mandatory field on list view. We have ACL to restrict this mandatory field, but would like to display error message as well, if possible.
Please advise.
Thanks,
Rajan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2019 10:40 PM
Hi Rajan,
So you can do this using before insert/update business rule with condition as below
use your field name here
current.<field> == ''
Script:
gs.addErrorMessage('Field <fieldName> cannot be left blank');
current.setAbortAction(true);
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2019 10:21 PM
Hi Rajan,
so you are saying you have a field which is mandatory and that is added to the list view; if any user tries to remove that field from the list view by personalizing the gear icon then message to be shown
This is not possible
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2019 08:42 AM
Hi Ankur,
Sorry for not being clear on my question. What I am saying that, I have a mandatory filed (also it is reference field) and which is visible and editable on list view by ITIL users, provided they don't leave it blank. So if someone tries to keep it blank, error message should pop up on top saying that it's mandatory field.
Hope this is clear now.
Thanks,
Rajan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2019 10:40 PM
Hi Rajan,
So you can do this using before insert/update business rule with condition as below
use your field name here
current.<field> == ''
Script:
gs.addErrorMessage('Field <fieldName> cannot be left blank');
current.setAbortAction(true);
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2019 10:53 AM
Thanks Ankur.
That worked. Cool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2019 04:41 AM
Hi Rajan,
You can try data policy as when you remove caller field data ie. Caller field to Empty
Then give error message “Caller field is mandatory” in incident list view
Please refer below images get more idea about it,
Image 1- data policy for reference filed --> caller
Image 2- Error message on the list view
Please mark as Correct Answer/Helpful, if applicable.
Regards,
Sagar Pagar