Shamma Negi
Kilo Sage

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