Is there any alternate way to check invalid glide record query apart from using "glide.invalid_query.returns_no_rows" property. My requirement is to check query is valid or not for an particular table, but when i am trying an invalid query its return

abhimundra
Kilo Explorer

Is there any alternate way to check invalid glide record query apart from using "glide.invalid_query.returns_no_rows" property.

My requirement is to check query is valid or not for an particular table, but when i am trying an invalid query its returning all the record instead of 0 record.

3 REPLIES 3

Chuck Tomasi
Tera Patron

You can override the property using this method:



gs.getSession().setStrictQuery(boolean);



I've also seen some people using a getQuery() method to validate that the query is not null. I think that's what it's called. Can't seem to find any docs on it (yet). So something like this;



gr.addQuery('acctive', true);



would return an empty string (indicating all records would be returned since that query would be ignored, but getQuery() would return null value.)


Can you please help me how we can use getQuery() to check if the query is invalid or not.


I misspoke, further testing shows there is no getQuery() method in GlideRecord().