View by employee Name

I have 2 database, one is for workflow and one is for attendance. In the attendance database, I have a view that is called My Time, a simple nice little view that will allow associates to see only their time that they have taken off. The formula for the view selection is:

SELECT employeeName=@Name([CN];@UserName) & Form_Name="Time Off" & Status="Approved" & All_Archive="Active"

Now in my second database, I would like to create the same type of view that is My Calls (since the 2nd is a call record database).

I have copied the same formula over and tweaked it to this:

SELECT employeeName=@Name([CN];@UserName) & Form_Name="Call" & Final_Archive="Active"

This does NOT work, what happens is that all the associate can see my actual calls I have logged and not theirs. But if I refresh the documents they all just go away. I do not understand how this can work in one database and not the other. I did not want to make these private views, so they are currently both shared. If anyone has any suggestions that would be fantastic!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi kali958,
Well, you really can't use a view to select documents for a particular user.  However, you can let the first column sort on @Name([CN];@UserName) , categorized, and then embed the view in a form and set the category  = to a computed for display field on the form that is @Name([CN];@UserName), also, set SaveOptions = "0".  This would not be a security measure, if people have ability to create views, or folders then they can read someone else's time.

You can also employ readers fields on the forms so that the user's name is included in their associated forms, so when they open the database they can only see their time (preferable, since it enforces security, and conforms to most HR standards about privacy)

Your reader's field would have to be a concatenation of HR Roles (who should be able to see all times) and the user declared on the form.

So, on the form you might have one name field for the user's name (canonicalized) and the reader's field that concatenates the name + the HR Role, something like: "[HRUsers]", and the administration role so that the SERVER can see the data, too: "[Admin]".

You would also need to add an administration server for the database, and set the update Names and Authors & readers fields so that if an employee has a name change, they don't lose their entries.

Test first on a separate database!  Because you're going to have to run an agent to update all the reader's fields.   If you don't do it correctly, you will end up with an empty database (that is bunches of records you can't see)


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hi kali958,
for views that contain @Username the best option is to use "Shared, private-on-first-use views" or "Shared, desktop private-on-first-use views".
That kind of view is shared and when the user first access it, it is saved (in your db or in the desktop.dsk, that's the difference between two mentioned types) as private view.
Locate "Private views" - "described" in designer's help index.

Hope this helps,
kali958Author Commented:
Thank you so much Marilyng - I think that I am going to do is the embedded view, that makes the most sense. I can control who creates views and such. Thanks again
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.