Authors Field Oddity

I have two pieces of code setting up authors fields on the back end using LS. One worked and on didn’t; the code was identical except for the value being entered as the author.

In the case of the one that did not work I was setting the value of the author to a role in the other case the value was set to another field. It seems with the role, when the doc was saved the current author lost his right to save the document but not so with the field value. Once I put the role name in a field and used that, thisngs worked okay. Any ideas why this is the case?

Example

doc.submittedBy_C = sess.CommonUserName

doc.submitDate_C = Format( Today, “Short Date”)

doc.authors_capa = doc.originalAuthor(0)

Dim item As NotesItem

Set item = doc.GetFirstItem(“authors_capa”)

item.IsAuthors = True

uidoc.RefreshHideFormulas

doc.ComputeWithForm False, False

doc.Save True, False, False

TIA

Merry Christmas and Happy Holidays

Dave

Subject: Authors Field Oddity

Two points to track :- check that the field originalAuthor always contains the common name or the full hierarchical name. if it contains a name in the abreviated shape, author field won’t work.

  • since you make a call to computeWithForm, make sure you haven’t got a formula in your form that overwrites the content of authors_capa