0
votes

I have huge number of uploaded document in Lotus notes. But the author field is not available in these documents. So user is not able to edit the document. It shows you are not authorized. I need a add a new field 'hdndocauthor' field with type 'Text List'.

Can anyone help me out, how to do it.

2
If all or a subset of users shall be able to edit every document in database then just set access level to "Editor" to all those users. - Knut Herrmann
I just want to note that a simple formula agent can easily add the hdndocauthor field, but the problem with this is that it will be a simple TEXT LIST instead of a READ/WRITE ACCESS NAMES list, which is what you really want. You can then refresh all documents, but the pitfall there is that if there are documents that fail validation formuilas it will take you forever to track them down and fix them. So the script approach in Jochen's answer is definitely the best way to do this. - Richard Schwartz

2 Answers

2
votes

Using LotusScript:

Dim item As NotesItem
Set item = doc.ReplaceItemValue("hdndocauthor", values)
item.IsAuthors = True

where doc references the underlying [back-end] document, and values is a Variant or String array containing the desired author names, which must be provided in canonical format.

0
votes

To add a new field you can also use NotesItem constructor with AUTHORS as specialType% parameter:

Dim item As New NotesItem(doc, "hdndocauthor", users, AUTHORS)