Shamma Negi
Kilo Sage
Options
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
01-18-2024
01:34 AM
Answer is "YES".
Let's see how we can disable or enable it.
The following example shows how to disable GlideFilter case-sensitivity with the setCaseSensitive() method. The filter matches the condition even though the case does not match the field value.
// Matches the 'Abel Tuter' user record
var gr = new GlideRecord('sys_user');
gr.query();
var condition = 'first_name=Abel';
var glideFilter = new GlideFilter(condition, 'filterCondition');
while (gr.next()) {
if (glideFilter.match(gr, true))
gs.info("Upper case condition: " + gr.getDisplayValue());
}
// The following code disables case sensitivity and matches the same record
var gr = new GlideRecord('sys_user');
gr.query();
var condition = 'first_name=abel';
var glideFilter = new GlideFilter(condition, 'filterCondition');
glideFilter.setCaseSensitive(false);
while (gr.next()) {
if (glideFilter.match(gr, true))
gs.info("Lower case condition: " + gr.getDisplayValue());
}The output reveals GlideFilter case-insensitive results:
Upper case condition: Abel Tuter Lower case condition: Abel Tuter
Hope this helps you.
I hope this article helpful. Please mark it as helpful and bookmark if you like it.
Regards,
Shamma Negi
2 Comments
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
