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?