This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Nov 9, 2011, 3:14 PM
4 Posts

getItemValues case sensitive?

  • Category: Server Side JavaScript
  • Platform: Linux
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 2
I'm pulling together my first set of serious (or going to be) XPages code. Is it right that the document.getItemValue (and getItemValueString etc) are case sensitive with respect to the field name?
 
This is a pretty big change, as I've never worried about the case of the field names before. When adding fields programatically in LS, they often appear in the document in all caps, whereas fields added through a form will have whatever case the form decides.
 
They're probably not even consistent through the documents in a single application (and to be honest I've never even had a capitalisation standard that I've stuck to for this)
 
From what I've seen (and this is just from trying to get a querySaveDocument to work, not through exhaustive testing) it might only be the first letter that matters, which to be honest is even more bizarre.
 
Can anyone throw some light on this - will I need to do a review of all my field names before I can  use XPages in anger (which will, in all probability rule it out completely for the forseeable future) or am I doing something wrong?
Nov 10, 2011, 4:21 PM
22 Posts
Re: getItemValues case sensitive? - NO.
The parameter or field name used in any of the getItemValue methods IS NOT case sensitive. The method names ARE case sensitive.
 
In other words all of these work the same:
 
vsimages = productDoc.getItemValue('images');
vsimages = productDoc.getItemValue('IMAGES')
vsimages = productDoc.getItemValue('ImAgEs');
vsimages = productDoc.getItemValue('ImageS');
 
But this will not work, or compile:
 
vsimages = productDoc.GETITEMVALUE('images'); 
 
the method NotesDocument.replaceItemValue('FieldName', value) will add the field to the database field list if it is not already there AND it adds it in the case format you used. The LS shortcut of being able to create fields using NotesDocument.FildName = value is what caused the database field list to have the uppercase field names. Using replaceItemValue in LS has the same behavior of adding the field in the case you specified.
 
Newbs
Nov 11, 2011, 4:08 PM
4 Posts
Re: getItemValues case sensitive?
Thanks, that's what I expected to happen (given it's been the case for every other domino language since I started at 4.5), but it doesn't correlate to what I was seeing (or didn't the other day)
 
I was running: document1.getItemValueString("FieldName") == document1.getItemValueString("fieldname") and getting a false...
 
 
I'll check it again, and file a bug report if it's still the same.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal