Why is a query not returning results?

Dave Clemmer
Mega Guru

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

3 REPLIES 3

Zach Koch
Giga Sage

Can you post screenshots of your business rule, and the list of records you are seeing for clarification?

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

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.