Readers field not created by LotusScript

My situation has 2 forms. Form 1 has a button that creates Form 2. Both forms have a Readers field called Readers. The user executing this function has a role of [Company A]. When the user pushes the button on Form 1, Form 2 gets created but, the Readers field of form 2 is not there. It is my understanding that the Readers field of form 2 should be populated with [Company A] when the NotesDocument.Save function is executed.

I use the following LotusScript code in the button’s Click event to create Form 2.

Dim usdoc As NotesDocument

Dim db As NotesDatabase

Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

'*****************************************************************************

'* Create the Form 2 document

'*****************************************************************************

Set uidoc = workspace.CurrentDocument

Set db =session.CurrentDatabase

Set usdoc = New NotesDocument(db)

usdoc.form = “Form 2”

usdoc.ProjectCodeName = uidoc.FieldGetText(“ProjectName”)

Call usdoc.Save(False, False)

Subject: Readers field not created by LotusScript

Edward,

If you are creating a document in script, the inherit functionality will not apply.

You will need to create and populate the field within your script

dim readers_item as new notesitem(usdoc, “Readers”, “[Company A]”)

readers_item.IsReaders=True

HTH

Mike

Subject: RE: Readers field not created by LotusScript

Alternatively if there are other fields that need to be created at the same time, a ComputeWithForm just before the save might suffice i.e.

Call usdoc.computeWithForm(True,True)

HTH - Rufus.