Authors fields not working on backend-created document

Hi,

My problem is that I have an agent that I run that creates a new document in the backend, and then saves it. On that document, there is a computed authors field, which I populate programatically with a person’s canonicalized name.

But the person in that authors field is unable to edit the document. When I do properties on the field, the Field Flags line says only:

Field Flags: SUMMARY

Once I (with mgr access) open the document, refresh it, and re-save it, the person in the authors field is then able to edit the document, and when I then do properties on the field, the line now reads:

Field Flags: SUMMARY READ/WRITE-ACCESS NAMES

Obviously, I can’t be manually going in and resaving every doc when it’s created. Any ideas on what’s going on here, and how I can fix it?

Thanks!

Subject: Authors fields not working on backend-created document

I assume your agent is in Lotuscript? If so, when creating the authors field, you need to make it a Names field and Type = Author

Like so:

Set item = doc.GetFirstItem( “Authors” )

item.IsAuthors = True

item.IsNames = True

Subject: Authors fields not working on backend-created document

I’m guessing that you’re populating the field with a line like this:

doc.fieldname = “whatever value”

The problem with that is that those flags you’re noticing don’t get set properly until you open the document in the client, where a different set of machinery kicks in and the form design imposes the flags on the field. What you need to do in your code is to use the NotesItem class to set the field and set the Authors property for the item to True.

Subject: Authors fields not working on backend-created document

Thanks! Worked like a charm!