Bruce,
I see a couple of problems with your code:
- I don't know if you copy-pasted it, but the first line reads NotesDoctument instead of NotesDocument (notice the extra t)
- On the 3rd line you're trying to store the created date in the FormCreated field. First: if you want to use a (SSJS) @-function, you'll need to write it as @Created() (notice the parentheses), second, the @Created() function returns a java Date object. If you want to store a NotesDateTimeObject, you'll have to use:
doc.replaceItemValue( "FormCreated", session.createDateTime( @Created() ) );
- The 3rd line should read:
doc.replaceItemValue("FormCreatedBy",@UserName() );
- Instead of
item = doc.replaceItemValue("AllReaders","[Specialist]")
item.appendToTextList("[Global Reader]")
you could use:
doc.replaceItemValue("AllReaders", [ "[Specialist]", "[Global Reader]" ]) ;
(this creates the array containing the 2 roles and adds it to the AllReaders field
Good luck!
Mark