Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Do not omit new button on a catalog item related list

Thomas98
Tera Expert

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
}

Thomas98_0-1734046548830.png

 

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@Thomas98 

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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

 

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. 

Thomas98_0-1734061106483.png