Search code examples
xpagesxpages-ssjsssjs

Xpages getting field value knowing the UNID of the document


Is there a way I can get the field value of a document if I know the document UNID?

I have the following code:

var a = database.getDocumentByUNID(sessionScope.unid);
  • sessionScope.unid contains the documentUNID.

I can't see any methods avaible if I do a. . Is there something wrong?


Solution

  • SSJS does not provide typeahead unless you specifically cast variables as the class you wish to use. So to get typeahead you need to use:

    var a:NotesDocument = database.getDocumentByUNID(sessionScope.unid);