Edit Box Be an Authors or Readers Field

Mindwatering Incorporated

Author: Tripp W Black

Created: 12/23/2010 at 03:55 PM

 

Category:
Notes Developer Tips
XPages

Issue:
How to make a field's value be an Authors or Readers field.

Option 1:
Compute with form on save option in xpage/custom control properties.

Option 2:
Use the following server-side event code for the save/submit data's event of the xpage/custom control:

QuerySaveDocument event
(xpage --> events --> data):

var authors = new Array("[admin]","[staff]");
var doc:NotesDocument = myDataSource.getDocument(true)
var item:NotesItem = doc.replaceItemValue("authorfieldname", authors);
item.setAuthors(true);
myDataSource.replaceItemValue("authorfieldname",item);
myDataSource.save();

Note:
myDataSource is the data source name of the document/data source of the XPage,

previous page