×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

View selection formula

View selection formula

View selection formula

(OP)
Hi Friends,

         I created a monthly account statement (Document) for each branch in our company. I need to restrict each branch staffs to view only their branch report. Say for example, if they open the database, in the default view they should be able to see only their branch report even though the view contains the all branch reports.

       To do this, when I create the report for each branch, in a special hidden field, I add all the user’s names whoever can view this document (Branch staff’s names).  In view selection formula window, I enter the following formula

SELECT (@Contains (<Hidden Filed Name>; @UserName))

    The application should check the current user name with the hidden field which contains the names and if the current user name available in that hidden field, that document should show in the view.

But it doesn’t work like this. Actually the document doesn’t show in the view even though the current user’s name is available in the hidden field. I’m using Lotus Notes R5.

  Is anyone having any idea why it doesn’t work or any other way to handle this problem?

 Any help you can provide would be appreciated.

Thanks.

RE: View selection formula

What is happening is that you are experiencing the side effects of what a view is and where it is built. The view you are using is public, and therefore it is always maintained on the server.
That means that the selection formula is asking the server to list all views that the current user has access to. Unfortunately, when the formula is evaluated, the current user is the server - which means no document is displayed.
Try replicating the db locally and you will see a document if you have created one.
To solve this issue, make the hidden field a reader-type field, and leave out @username from the view selection formula.
Of course, you will also need to create a role and include that role in every report. Assign that role to the managers who should have access to all reports.
Another solution would be to make the view shared, but private on first use. In this case, it is the client that maintains the list (technically not always true since R5, but it all boils down to the same), so you can use @username in the selection formula and it will work as intended.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close