View definition (initialize method) doesn't run in web client

I posted this in a reply to an earlier thread but was afraid no one would see it so I’m reposting.

I modified a view in order to dynamically rewrite the selection formula, using instructions/ideas from an article I found at IBM Developer. I did this by writing code in the initialize subroutine of the view. The purpose was to filter certain documents from the view depending on which of several users are looking at it.

This works in the Notes client, but for users who are opening the view in a web client, the initialize subroutine is evidently not firing, so they see documents they shouldn’t see, or docs they should see are hidden from them.

The test users have access to both the Notes client and (obviously) the web; if they access the view in the notes client and refresh it there, and then refresh the web view, they see the correct set of docs. But many of our real users will not have access to the notes client.

The users have the equivalent of designer access.

Does anyone have any idea why this is happening? Is it possible to force the subroutine to run if the view is opened on the web?

TIA.

Subject: Put your code in an agent when run on web client