1
votes

I have a formA where I have a field '_author' which is of type Authors/Computed for display with value (@Subset($Updatedby;1)). I display information from formA on viewA. What I want to achieve is that documents that are created by you are only visible to yourself on viewA. I tried the following formula in viewA 'View Selection': SELECT (form = "formA" & @UserName =_author). Even though I know that these two variables have the same values when I read it from the document's properties, the condition is not satisfied and I do not see a single document. If I delete everything after "&", the view shows all documents. All is hosted on a server which handles users.

2
You've forgotten that the index of the view is build Server side and won't be recalculated for each user (unless you defined it private on first use. I don't recommand this last setting for many reasons). - Emmanuel Gleizer

2 Answers

4
votes

A handy workaround is to create a Page with an embedded view. This view is exactly like your view but has an additional first categorized (!) column with your field _author.

Put into embedded view's property "Show single category" the formula @UserName or @Name([CN]; @UserName) depending on how your categorized column _author is formatted. Show then always the Page instead of the view.

This way you avoid trouble with "Shared, private on first use" views and users see exactly their own documents only.

1
votes

@UserName works in a special manner in selection formulas in views. In your case the view should be Private on First Use. Read further here: http://www-01.ibm.com/support/docview.wss?uid=swg21089773 .

Be aware that this lead to all sort of issues, e.g. when you update the design of the view users must remove the view manually to get the changes deployed.