Updating $reader's field

I have to update the reader’s field from Tulsi/ABC to Tulsi/XYZ – XYZ being the current domain’s certifier.

I have the following code in input translation of $Reader’s field:

“LocalDomainServers” : “AppAdmin” : namM : namB

The following code is placed in refresh documents, the agent which i have created :


Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim form As NotesForm

Dim view As NotesView

Dim doc As NotesDocument

Dim newReaders(0 To 63) As String

Dim reader As String

Set db = session.CurrentDatabase

Set view = db.getview("MyWork")

Set doc=view.GetFirstDocument

While Not doc Is Nothing

	If doc.Form(0)="Request" Then

		newReaders(n) = doc.namM(0)

		newReaders(n+1) = doc.namB(0)

					Call doc.ReplaceItemValue("$Readers",newReaders)

	End If

Wend

End Sub


But it is not changing the names as expected. Please advise.

Subject: updating $reader’s field

You should not use $readers as a field name.

In general: see http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/4fa401fe4aaea7278525739c003d13da?OpenDocument

This case specific: When you look at the 4th tab of the document properties, you can set “Who can read this document”. When you select a group/user/server/etc. here, the values are stored in a field called $readers.

So if you change the fieldname, it will work

Subject: updating $reader’s field

did you save the doc?I don’t see it in your code

regards

Subject: RE: updating $reader’s field

Yes i Have save in my code. Forgot to include it in this forum.