Get Notes Document and Get or Set Field Values via Server-Side JavaScript

Mindwatering Incorporated

Author: Tripp W Black

Created: 08/19/2010 at 02:47 AM

 

Category:
Notes Developer Tips
XPages

Issue:
You would like to get or set a value in the NotesDocument on the server side, that isn't part of the editable fields.

Solution:
You could create hidden edit boxes that compute a value that are bound to the correct NotesDocument field.

You could use JavaScript:
var doc:NotesDocument = datasourcename.getDocument();
var myfldval = datasourcename.getValue("MyFieldName); // gets a field string value and populates JS variable myfldval
...
doc.replaceItemValue("MyFieldName", "NewValueString"); // replaces doc field with new value
...
datasourcename.getDocument(true); // refresh document, somewhat like uiDoc.Refresh(), uiDoc.Reload()


previous page