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



Jun 19, 2013, 4:03 AM
6 Posts
topic has been resolvedResolved

getItemValueArray behaves differently on a Data source doc vs a SSJS declared doc

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 9.0
  • Role: Developer
  • Tags: getItemValueArray
  • Replies: 2

Lost a bunch of time on this. Finally resolved - this was it.

var xArray = new Array();
xArray = doc.getItemValueArray("mtytextlistfield");

The above code worked beatuiflly when doc was a defined data source for the xpage.

Then I had to switch doc to SSJS declared as I needed to use Session as signer to get around a Readers field issue. Unless  there is a way to declare a data source as signer? So I did this.

var thisDB:NotesDatabase = sessionAsSigner.getDatabase(database.getServer(),database.getFilePath());
var doc:NotesDocument  =  thisDB.getDocumentByUNID(thedocid);

This worked fine - but the line

xArray = doc.getItemValueArray("mtytextlistfield"); 

no longer worked. I switched my code to getItemValue instead of getItemValueArray and then all was fine

xArray = doc.getItemValue("mtytextlistfield"); 

 

Why would this be? I can duplicate this problem with other documents that have no Readers field. Unless I define the document as an Xpage data Source the doc.getItemValueArray method gives an error every time....

Does anybody know why?

 

Jun 19, 2013, 12:53 PM
298 Posts
two different objects?
I assume in your first example that doc was the data source name?  That is not a NotesDocument object but a NotesXSPDocument.  This has a getItemValueArray.  Your second example is a NotesDocument and the getItemValueArray method does not exist.

See the documentation on NotesXSPDocument and the Document class under the Domino classes.


Howard

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