Server-side GlideRecord addQuery case sensitive

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2017 10:18 AM
Looking at this Case insensitive Glide Record query I see they talk about client side GlideRecord queries.
I need server side to be case sensitive.
The highlighted sections must be a cAsE sEnSiTiVe check.
How can I make it so?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2017 10:47 AM
GlideRecord queries are case insensitive. I think your best option is to pull what you have there and do a quick String comparison such as:
idk if you need the .toString() but i put it there just in case...
....
while(gr.next()){
if(gr.u_quick_access_event_title.toString() == input.addQuickAccessEvent.toString()){
//execute code here
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2017 10:52 AM
Yeah, since I can't do it in the addQuery, I'll have to do it afterward by manually pulling the value and then using javascript to compare ASCII values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2017 10:57 AM
I would suggest validate before adding into query the "input.addQuickAccessEvent" if its case sensitive do glide query.
Procedure for Ensuring Your Custom Scripts Work with Case-Insensitive Text
If your Inbound Email action scripts contain Javascript patterns similar to the following, then it is best practice to review your code for possible case-sensitivity issues. An example of case-sensitive Javascript looks like this:
Bad practice, because indexOf() requires perfect case-sensitive comparison:
if (yourVariable.indexOf("Incident Opened") != -1) {
// Do something important here, based on text "Incident Opened"
// The problem is that "Incident Opened" will not match
}
Best practice:
if (yourVariable.toLowerCase().indexOf("incident opened") != -1) {
// This will match "Incident Opened", "incident Opened", "Incident opened", etc.
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2017 11:16 AM