logo

NJP

Adding a Filter to a normal Related List

Import · Jun 30, 2022 · article

I thought I'd do a bit of a write-up about an issue that I had with getting a Related List Entry modification migrated between instances via Update Set. I've found that if you manually modify a Related List Entry, you have to do some additional stuff to get it to be added to an Update Set for migration. Here's my findings below - hopefully this helps someone else who is struggling with sys_ui_related_list_entry records!

Related lists [sys_ui_related_list] can have additional filters added to them under the Related List Entry [sys_ui_related_list_entry] record, however simply updating the record isn't enough to get the change captured by an Update Set.

When you add a Related List to a record (for example adding "Incident Task" to the Incident Table) using the "Configure -> Related Lists" context menu ServiceNow creates a record which is a complete collection of the two record types which make up the Related List configuration. It's only when you perform this action that these records are captured in Update Sets and appear as sys_ui_related__.

At the same time that you use Configure Related Lists, you are ALSO updating or creating the sys_ui_related_list_entry record:

image

As you can see in the List above, there's a field called "Filter" which lets you set additional filter conditions for the related list. You CAN manually edit this field in the sys_ui_related_list_entry record but be aware that simply updating the record WON'T add it to your update set - there's an additional step to get this change into your Update Set.

In order to force the new filter condition into your update set, you will need to go back to "Configure -> Related Lists" and make a change that will refresh the update in the update set like moving a related list in the order and moving it back again (i.e. it will create an update for the sys_ui_related_* object which contains the entire Related List configuration). Your manually changed filter will be captured by this action, and the Update Set will be able to successfully migrate.

View original source

https://www.servicenow.com/community/now-platform-articles/adding-a-filter-to-a-normal-related-list/ta-p/2315679