Copying private views back into a db

We have a very large database with 528 views and about 150 are private views stored in the server database. I know, I know, cut down the number of views in the database and prevent private views on the server, gotcha. My question is… I created an agent to remove all private view from the server copy using “run on server” and “run on behalf of”. I can get the private views out but is there any way to put them back in as private views.

When I remove them with my agent they are no longer private and if I need to add one back because a user actually needs it I can’t put it back as a private view. I see that the isprivate prop of a notesview is read-only. Can I set this with c api or any other way?

Subject: Copying private views back into a db

Hello Andrew.

I’ve tried to remove the private views stored in the server database but I just remove my private views.

Could I have your source code agent?

Thanks in advance

Subject: Copying private views back into a db

I’m guessing, but it’s worth a shot.

I notice on my private view the following fields are different from the other views:

$Flag = “PYV”

$Author = “CN/myname…”

Perhaps if you set these fields on the view after putting it back?