GlideRecord query condition "does not equal" for related list

JJG
Kilo Guru

I have a related list on a contract record, and I would like to add a condition to the filter so that it does not show records where the status is Processing - Pre Hire

 

Here is the code from the relationship record:

find_real_file.png

 

Yet when I check the related list on the contract form, I do not see the status != "Processing - Pre Hire" in the filter. What am I missing?

find_real_file.png

3 REPLIES 3

Brad Bowman
Kilo Patron
Kilo Patron

The easiest way to confirm that your query is correct is to right-click on the Processing... status in the related list and choose Show Matching, so that now it is in the filter (in the affirmative).  Right click on that last element of the filter and choose Copy Query.  Paste that into your relationship definition and verify that the field name and value (case and space-sensitive) is the same as what you are using in your addQuery line.

Copy and pasting the query into the relationship does not work and produces an error.

find_real_file.png

The point of pasting the query is to make sure the same field names and expected values are used in your addQuery lines.  We know contract and parent.sys_id are good since you are presumably seeing the record(s) for the correct Contract in the related list.  The screen shot above confirms that 'status' is the correct field name to use for the second addQuery line, but the value is still in question since you changed it to = a different one.  If you really want everything except processing pre hire, then copy the value from the pasted query into the addQuery value that you are testing to confirm that there aren't any typos or a difference in spaces or special characters, then delete/comment out the pasted query.