I have a querySaveDocument function for my xPage where I set up some backend fields, including Authors and Readers fields.
var authors = new Array("[AdminEditors]");
var user:String=session.getEffectiveUserName();
authors.push( user );
var authitem:NotesItem = doc.replaceItemValue("z_Authors", authors );
authitem.setAuthors(true);
var readitem:NotesItem = doc.replaceItemValue("z_Readers", "[AdminReaders]" );
readitem.setReaders(true);
I thought doc.replaceItemValue() would return a reference to the NotesItem, but authItem is null.
So how does one create a field on the backend Notes Document using SSJS and get a reference to it?
Thanks,
-- Jeff
Make sure to use getDocument(true) to have the backend document synced with changes made in the frontend document.
var doc = document1.getDocument(true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With