Catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 04:23 AM
Hi All,
How to put validation that a particular catalog item cannot be submitted more than thrice in a day?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 04:50 AM
Apply user criteria and check using user criteria script how many RITMs are there for logged in user for today
If more than 3 then hide it from portal itself so that they can't submit
Then add this user criteria in Available for related list
var rec = new GlideRecord('sc_req_item');
rec.addQuery('cat_item.name', 'Your Item Name');
rec.addEncodedQuery('sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()');
rec.addQuery('requested_for', user_id);
rec.query();
if (rec.getRowCount() > 3)
answer = false;
else
answer = true;
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
02-07-2025 04:51 AM
not for one user.. in a day it should not be submitted more than thrice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 05:01 AM
then comment this line and the logic should work fine
rec.addQuery('requested_for', user_id);
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
02-10-2025 05:43 AM
Hi Ankur ,
i have written following script include: