Contact Information
- Email: ctoohey@dominoguru.com
- BleedYelow.com: Chris Toohey
- Skype: ChrisToohey
- Gizmo: ChrisToohey
- Yahoo!: ChrsToohey
- Google: ChristopherToohey
(ctoohey@dominoguru.com) - AIM: ChrisToohey
- Twitter: ChrisToohey
- Facebook: ChrisToohey
- LinkedIn: Chris Toohey
- Podcast Information
http://www.yellowcast.net
YellowCast @ Twitter - RSS:

- Guru Tag:

Like what you see? Help feed-the-beast by donating to the site and it's humbly thankful author!
My Twitter Updates
Publishings
Domino Development and Data Store Architecture 06/06/2008Domino Development RIM's Blackberry Connections Client - First Impressions (Part 2) 05/19/2008
My Gear RIM's Blackberry Connections Client - First Impressions 05/19/2008
My Gear Remove my name from the Domino Directory!! 02/05/2008
Lotus Notes Quick and Dirty Mail Application Document Importing 01/24/2008
Methods and Strategies Publishings Archive
Examples & Downloads
xCopy v0.2 - OS xcopy Client for Lotus Notes 08/07/2008Examples and Downloads xCopy - Local Archiving and File Copying Utility for Lotus Notes 07/22/2008
Examples and Downloads SOTU - Remote Console Reporting v0.2 07/11/2008
Products Self-Discovery leading to more content, downloads, and examples 07/01/2008
Examples and Downloads Sorting Hat v0.1 06/30/2008
Lotus Notes E & D Archive
Resources
PlanetLotus.org [ Community ] Alan Lepofsky's Notes Tips [ Community ] Chris' The Business Controls Caddy [ Community ] Petr Stanicek [pixy] [ CSS ] JoeLitton.net [ Community ] Resources ArchiveBleedYellow.com Dogears
View Selection Formulas Redux
06/16/2005 06:20:00 AM | Chris Toohey | Saylorsburg, PA
This one's going to be a real concept-based article, so kids and parents with weak stomachs may want to stop reading at this point (please read that if you're looking for a copy/paste code snippet, please keep moving along...!)
Ok, VSFs (View Selection Formulas) - a very basic function, but recently I've been working on enhancing view usage via a combination of document-level rules and some Lotus Notes Kung-Foo.
A quick example:
I need a view for all open tickets in my Helpdesk system (guess what I've been working on lately...):
SELECT ( (form = "ticket") & (status = "Open") )
VERY basic stuff here... but what if you needed a more controllable view, a more finite list, but didn't want to have to modify your VSFs everytime someone in Customer Service said "hey! I got an idea..."?
Let's say I want to control just where a document is going, at any point within the documents life, at any point within my application. The solution that I am suggesting here is a three-step process:
- Add a field to your form.
- Modify your VSFs.
- Add "rules" via the workflow and function of your application to populate said field.
First, we'll add a field to your forms: vInclude

We will use this Computed to itself multi-value text field in the next two steps, but the basics are to create this hidden field used soley (for this example) to populate what views I wish to display this document in... but more on that later.
We'll now modify our VSFs by settings this very blanket yet dynamic and functional formula:
SELECT vInclude="" | @IsMember(@Subset(@ViewTitle;-1);vInclude)
This tells the view to include all documents that either don't have the vInclude populated, or that have it populated with the alias of the current view.
For example of this in action:
View Title: Open Tickets|opentickets
If you set the document's vInclude field to "opentickets" or "opentickets":"openbydept", this document will be set to display in the Open Tickets view.
For the addition of "rules" via workflow and function for your application, I'm talking about manipulating your application to populate the vInclude field. This makes sense for, say, a Helpdesk application.
The logic: if it's an open ticket and a master ticket with with child/dependant tickets, set the vInclude field to "opentickets":"openbydept":"openmastertickets".
While this approach may not be suited for all of your applications, I've found already that it lends true Rapid Application Development for the creation of many views - it's pretty much just copy/paste, knowing that the View Selection Formula will always be accurate!
Like what you see? Help feed-the-beast by donating to the site and it's humbly thankful author!
Chris Toohey | Domino Guru

Comments
Been a long time since I have done notes. I need to create a view that will return to me all documents that do not have children docs. Can you help/ thanks.