Workspace related lists count

George_1
Giga Guru
When I open a record, the related tab “Diagnosis and Recovery Tasks” initially shows a count of 5. However, when I click and open the related list tab, it loads and displays the actual count, which is 149 records.
 
Any suggestions on where to debug this.
 
George_1_1-1780841162877.png

 

George_1_2-1780841169377.png

 


 

1 ACCEPTED SOLUTION

Naveen20
ServiceNow Employee

@George_1 

This is almost always a defined relationship script or a before-query business rule that evaluates differently for the count versus the list.

You may Debug as below

Open the related list definition (right-click the list header > Configure > Related Lists, or check sys_relationship). If "Diagnosis and Recovery Tasks" is a defined relationship, inspect its "Query with" script — the count and list often diverge here.
Check for before-query business rules on the target task table that conditionally add filters.
Enable session debug (SQL/Security) and compare the encoded query fired for the count tab vs. the opened list. Related lists can return the wrong number of records when a query rule or relationship is involved.

View solution in original post

9 REPLIES 9

@George_1 

was this working fine earlier and you recently upgraded?

if yes then raise a case with ServiceNow

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar , it was noticed even before upgrade.

@George_1 

how about other workspaces? like CSM etc

If same behavior then it seems some property is controlling it

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Dr Atul G- LNG
Tera Patron

not sure, but try to repair the plugin.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Naveen20
ServiceNow Employee

@George_1 

This is almost always a defined relationship script or a before-query business rule that evaluates differently for the count versus the list.

You may Debug as below

Open the related list definition (right-click the list header > Configure > Related Lists, or check sys_relationship). If "Diagnosis and Recovery Tasks" is a defined relationship, inspect its "Query with" script — the count and list often diverge here.
Check for before-query business rules on the target task table that conditionally add filters.
Enable session debug (SQL/Security) and compare the encoded query fired for the count tab vs. the opened list. Related lists can return the wrong number of records when a query rule or relationship is involved.