In a view that I’ve created, I only want the user to see their work and nobody else’s. Each user has to log in at the start of the application. I have an Author field on each form which displays the users common name. The code I’ve used is:
The best way to do this is using personal views. I also had problems with public views which should only show documents of the current user. Sometimes it works, sometimes it doesn’t. Create a new view of the type public, personal on first use. Together with the selection criteria it will do what you expect.
I will recommend you to us Readers and Authors Fields to restict access to documents. Can be a little bit tricky to understand, so read about it in the designer help.
Make sure the name in the reader field is in canonical format. If you need to display it use a second field or computed text and convert the name on the flight.
An alternative is to use an embedded (categorised on name) view on a form and use the single category option of that embedded view to display only the category @Name([…];@Username)