Readers Field via Script

I'm having a strange problem when populating a Readers field via script. I'm loading external data to a Notes DB & need to secure documents via a Readers field. In script I build an array of Roles allowed to see the document & store it in a Readers field. But everyone can view the document until I edit & save it within the UI. After saving it, only the appropriate Roles can access it & it works as expected.

Is there some special way to populate a Readers field via script that I'm missing? What's so magical about the UI that would cause an already populated Readers field to behave as one, even though I haven't changed a thing?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

kobluckiConnect With a Mentor Commented:
Before you do a backend document save,false,false)
append the values to the field then
set item=doc.getfirstitem("Reader field name")
RayboneAuthor Commented:
This did the trick. Thanks so much. I also see the IsNames & IsAuthors properties that will help me. I guess you just need to know where to look.

Thanks Again
All Courses

From novice to tech pro — start learning today.