Why is a query not returning results?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2022 08:37 AM
I'm running into a problem that doesn't make sense to me.
I have two tables, one of which references the other.
If I 'Show List' on the first one, filtering by setting the value for the reference to a known value and one other field, I get three records.
I have a business rule on the referenced table that runs the exact same query (I even did a 'Copy query' from the 'Show List' page, after filtering, and pasted it into the call to GlideRecord.addEncodedQuery(), just to make sure I wasn't imagining things), but is seeing zero results (I checked the return values from both hasNext() and next()). Another sanity check is that I put a call to GlideRecord.canRead(), and verified that it isn't a permissions problem (and just to be stupidly redundant, I even opened up each of the three records from the 'Show List', and was able to open all of them without issue).
The business rule is definitely running when I expect it to run (some logging messages are reached).
Any suggestions on what might be happening? Or what else might be worth taking a look at?
Thanks,
Dave
- Labels:
-
Now Experience UI Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2022 08:39 AM
Can you post screenshots of your business rule, and the list of records you are seeing for clarification?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2022 09:57 AM
Our system is on an isolated network, so I cannot. I guess I can cross-type some of it, though.
....
Ok, cutting off there, because cross-typing was enough for me to see the mistake I had made, which is that the one log message I was looking for was the one message where I had failed to set the source. So, when I queried for messages from that source, I didn't get it.
Ugh. Sorry, all.
-Dave

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2022 06:05 AM
No problem, happy you solved your issue. It is better to reach out and end up not needing it than never reach out and struggle with something that a new pair of eyes may be able to assist with.