Hide 'New' in catalog task related list for RITM for some Catalog Items

Reus
Tera Expert

I need to hide 'New' button present in catalog task related list for RITM for some specific catalog items.

Reus_1-1744019602097.png

 

I tried omit new condition script to hide it, but as there are not catalog task present, it's not querying

 

Code:

var answer;
if (current.cat_item.sys_id == '2c413a5b831312108b59f7c6feaad35d' ) {  //catalog item sys_id
    answer = true;
} else {
    answer = false;
}
answer;
1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Reus 

it should be this

if (parent.cat_item.sys_id == '2c413a5b831312108b59f7c6feaad35d' ) {  //catalog item sys_id
    answer = true; // omit
} else {
    answer = false; // hide
}

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Reus 

it should be this

if (parent.cat_item.sys_id == '2c413a5b831312108b59f7c6feaad35d' ) {  //catalog item sys_id
    answer = true; // omit
} else {
    answer = false; // hide
}

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

@Reus 

I could see you marked my response as correct earlier and now it is not.

Did my script not work for you?

It should hide New button if it's catalog item with sysId "2c413a5b831312108b59f7c6feaad35d".

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

It did work. thanks