Do not omit new button on a catalog item related list
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2024 03:35 PM
I have a requirement not to omit new button on a particular catalog item (RITM) related list and the code doesnt seem to work.
Can someone please provide some insight on what I'm doing wrong?
var gr = new GlideRecord('sc_req_item');
if (gr.get(parent.sys_id) && gr.cat_item == '6f4979cf4f078600e07d3f828010c703') {
answer = false; // Ensure the "New" button is not omitted for this catalog item
} else {
answer = !parent.active; // Existing logic applies for other items
}
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2024 07:32 PM
try this
if (parent.request_item.cat_item == '6f4979cf4f078600e07d3f828010c703') {
answer = false; // Ensure the "New" button is not omitted for this catalog item
} else {
answer = !parent.active; // Existing logic applies for other items
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2024 07:39 PM
Hi Ankur,
thanks for looking into it.
I used the exact same code you provided, validated the the sysid too, and it did not work, also confirmed the RITM was active.