I have this SELECT formula in a view that has the fields “StopTime” and “Employee” in it, and in the form. It does not filter the “Employee”. It does, however, filter the other two elements. Employee is in a catagorized column in the working and non-working example.
SELECT ((Form = “Time Card”) | (Form = “tc”)) & (@Text(StopTime) = “”) & (Employee = @Name([CN]; @V3UserName))
In a different view I am using this and it does filter by “Employee”.
SELECT ((Form = “Time Card”) | (Form = “tc”)) & @Today = @Date(StartTime) & Employee = @Name([CN]; @V3UserName)
I can’t see where I’ve gone wroing. Any help would be appreciated on this.
Subject: SELECT formula in view not working
The problem is that you’ve used @V3UserName. @V3UserName (and @UserName) basically don’t work in view selection formulas unless they’re private views. Read the entire documentation for both of those commands in the help, paying particular attention to the Usage section, for more details.
Subject: RE: SELECT formula in view not working
I respectfully disagree. I have public views that use @UserName in the view selection that have worked perfectly for years. Maybe I’ve just been lucky.
Subject: RE: SELECT formula in view not working
Okay, I’m a moron. They weren’t working but nobody told me. =P I have since switched to Shared, Private on First Use views and they work great
Subject: RE: SELECT formula in view not working
On the strength of the documentation and countless posts here and on the lnotes-l mailing list asking why view selection formulas with @UserName don’t work, I strongly suspect that you’re both extremely lucky and operating under highly unusual circumstances. I’ve seen it work myself briefly, but it breaks down under any real use. For the vast majority of us, the documentation is dead on.
Subject: RE: SELECT formula in view not working
I changed the refresh from “from bottom” to “from top” and it works fine now. –
I also have used the user in selection formulas
in the past and they do work. Maybe not when refreshing from bottom though.
Thanks to everyone!
J.R.
Subject: RE: SELECT formula in view not working
What is a good alternative to using the User in the view. I got it working, but am concerned it won’t hold up under stress.
An embedded view is not an option for me in this application.
Thanks,
J.R.
Subject: RE: SELECT formula in view not working
An embedded view might not work, but by golly, you’re on Notes 6+. Use @SetViewInfo to restrict to the desired category.
And no, it definitely won’t hold up under stress, where “under stress” means that more than one person needs to access the view at any given time.
Subject: RE: SELECT formula in view not working
What is a good alternative to using the User in the view.
Well, you could use an embedded view.
An embedded view is not an option for me in this application.
Damn.
Look into private views. @Username works just fine in those. I’d expect your current solution to start breaking down once multiple users start looking at the view.
Subject: RE: SELECT formula in view not working
Alternative? From the Designer help:
Shared, private-on-first-use views
A “Shared, private-on-first-use” view begins as a shared view and becomes a private view as soon as a user accesses and saves the view. These views give you a convenient way to distribute personal views to multiple users. You usually create this type of view by using @UserName to customize the display for each user.
Note that this is the only way to make a view work with @username, because the view selection is only parsed when the view is generated. Thus, if Tom opened a shared view that keyed to @username, all of Tom’s documents would display. But, if the view is still open when Jay accesses it, Jay sees all of Tom’s documents, and does not see his own. So, to avoid this conflict, designate the view as “Shared, private on first use” when using @username in the selection formula.
After a user saves a shared-to-private view, the user’s copy of the view no longer inherits design changes. For example, if you add a column to the view, anyone using a private version of the view won’t see the new column. To obtain design changes, users must delete their private versions of the view and open the shared-to-private view again.
Shared-to-private views are not a security measure, as they do not protect data. If you create a shared-to-private view that omits certain documents, a user can still create a private view that includes them.
Shared-to-private views are stored in the database as long as they are shared. After the first use, Domino uses the “Create personal folders/views” option to determine where to store the view.
Subject: SELECT formula in view not working
I guess I’ve been lucky too because I have several views that only the employee themselves should see and my view selection is:
Form = “TR” & @UserName = Employee
It’s worked consistently and it does exactly what it says it does. I’m not using the CN or the V3 maybe that’s the difference. The only problem I have found is that I can’t use this formula and categorize the first column which is employee. If you do that then everyone sees the category name but no documents under the category. Maybe I’m confused, is this different than what you’re talking about? I have 4 db’s that I am using this in and haven’t had any problems.
Subject: RE: SELECT formula in view not working
Get out of the habit – the apparent lack of problems comes from light usage. Unless the view is private or is being used only in local replicas, eventually you will run into a situation where one user’s documents are still indexed into the view when another user enters. User 2 gets to see both sets. As more users hit the view, more documents are indexed in. User 1 refreshes, and is surprised when dozens of documents appear out of nowhere. It happens. These fora are full of postings with that problem description.
Subject: RE: SELECT formula in view not working
this remind me of me and my colleague testing.We were testing @username on a view. Mine can’t work, but he claim his can work!
And we figure out something at the end, that if ur database is on local, @username in view does work!. If the database is on server, it can’t work. Hope this will clear the mystery why sometimes it work, and sometimes it doesn’t.
Subject: RE: SELECT formula in view not working
The databases that I have this working in are very low end dbs. Travel requests, mileage reimbursements. Db’s that are not typically used on a daily basis. This probably explains why it consistently works. My coworker on the other hand is using this formula in her timekeeping db and has problems all the time. So there is some sense to the statement - it works sometimes and not others.
Hard to believe a solution hasn’t been found, this seems like a very useful tool.
Subject: SELECT formula in view not working
Congratulations. You are the 5,234 person to discover and post that @Userid does not work in view selection formulas, just as the documentation say it doesn’t.
{ Insert your favorite “Please search the forums before posting a problem” statement here }
Is it the weekend yet ?