Does System Property "glide.invalid_query.returns_no_rows" support in multi domain instance?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2022 08:18 PM
Hello there,
In our ServiceNow Instance, we are using multi domain management, i.e. we have multiple customers due to which we have domain management to hide data from one customer to another customer.
In this situation, if we enable the property "glide.invalid_query.returns_no_rows" to avoid unwanted custom queries to execute, would it work? or will there be impact in data visibility due to domain management?
Thanks,
Vasanth
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2022 08:50 PM
Hi,
glide.invalid_query.returns_no_rowsControls how invalid GlideRecord queries are handled with respect to invalid or undefined field names. When this property is true, invalid queries containing invalid or undefined field names always return no rows. When this property is false (default), if a query is incorrect, and includes invalid or undefined field names, the invalid part of the query condition is ignored and results are based on the valid part of the query.
To override this logic at the session level, execute gs.getSession().setStrictQuery(false)
. To restore strict query, execute gs.getSession().setStrictQuery(true)
. To use this property, change the line gr.addQuery('table', arguments.length == 1 ? record.getRecordClassName() : tableName);
in the Workflow script include to gr.addQuery('table', (tableName) ? tableName : record.getRecordClassName() );
.
- Type: true | false
- Default value: false
- Location: Add the property to the System Property [sys_properties] table.
- Also, refer to this video : https://www.youtube.com/watch?v=-8uirTT_a8g
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2022 08:57 PM
Hi
I think you have not really understood the meaning of this feature. This property will not prevent "unwanted" queries, but will abort queries which are wrong from a technical point of view. For example, if you use wrong field names. Set to "false" such a query would return all tables rows a user has access to.
Enabling this property is therefore highly recommended.
Maik