Omit new condition not working on Problem form

varunp
Tera Guru

We are on Kingston version.

 

I want to hide the new and Edit button from Problem form under the incident related list

I configured the list control with the below script. 

 

The EDIT button is invisible but not the NEW button.

 

 

find_real_file.png

 

find_real_file.png

 

I want to add some condition. If the problem ticket is inactive then hide the buttons.

The problem is it is not working even without condition.

1 ACCEPTED SOLUTION

Jim Coyne
Kilo Patron

In order for the "Omit new condition" script to work, you need to change the condition on the "New" UI Action on the Incident table.  There are a number of "New" UI Actions on the Incident table that override the global one.  The one you want to edit should be this one:

https://instancename.service-now.com/sys_ui_action_list.do?sysparm_query=sys_id%3Dbb80a37c0f320000b1...

It is a "List banner button" UI Action with the following "Condition":

current.canCreate() && !RP.getListControl().isOmitNewButtonWithoutChecks() && RP.isRelatedList() && !RP.isManyToMany()

Change "isOmitNewButtonWithoutChecks" to "isOmitNewButton" so that it checks the condition script.

View solution in original post

10 REPLIES 10

Hi,

The Incident New button on the related list is overriding the omit new condition checks from a list control. Please follow these steps if you need to run scripts to omit New button on Incident related list.

1) Open the New button UI action - https://instance_name.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=bb80a37c0f320000b12e6903cfe01218

Replace instance_name with your instance name

2) Replace the UI Action condition from

current.canCreate() && !RP.getListControl().isOmitNewButtonWithoutChecks() && RP.isRelatedList() && !RP.isManyToMany()

To

current.canCreate() && !RP.getListControl().isOmitNewButton() && RP.isRelatedList() && !RP.isManyToMany()

This should allow the conditions to work on New button allowing it to check omit new button conditions on incident related lists.

Let me know if it worked

Please mark reply as Helpful/Correct, if applicable. Thanks!