API
@-Formulas
JavaScript
LotusScript
Reg Exp
Web Design
Notes Client
XPages
 
Different Home For Different Releases
On a recent project, we had to deal with the possibility that some of the users would be accessing the application with Notes 4.6, but the majority of users would be coming in with Notes 5. With most of the users on Notes 5, we wanted take advantage of the new features in R5 like framesets and outlines. But the application still had to work for the small number of Notes 4.6 users.

What to do??

We ended up with a fairly elegant solution to the problem. First, the application was set up to launch "Restore as last used by user" and the checkmark for "Show About Database document when database is opened for the first time" was turned off.

Next, we designed the application to have a default view. Since there is a default view and the "Restore" option is set, when the database is first opened by a user (no matter what version of the Notes client), that default view will be opened.

Finally, we went to the Database Script area (found in the "Other" design tab) and went to the PostOpen database event. We changed the code to be Formula instead of LotusScript and put in the following formula:

@If(@TextToNumber(@Version) < 166; @Command([OpenNavigator]; "Notes 4.6 Navigation"; "1"); @Command([OpenFrameset]; "Notes 5 Navigation Frameset"));
@PostedCommand([FileOpenDatabase]; @DbName);
@PostedCommand([FileCloseWindow])

Luckily, the @If function terminates when it finds some matching value, and doesn't look through the rest of the function. Knowing this, we make the check for having a pre-R5 client first. If the client is earlier than Notes 5, then open the "Notes 4.6 Navigation" navigator in full screen mode. For pre-R5 clients, the rest of the @If is ignored, so the fact that there's code in the line that won't be recognized doesn't matter. If the user is R5 or later, the "Notes 5 Navigation Frameset" frameset will be opened.

In either case, the default view is still opened to the user (both the commands from the first line open up a new window). So we open up the database again (which will restore the window of the default view) and then close that restored window, leaving the user back in the navigator (4.6) or the frameset (5.x and higher).

At this point, the different navigation pages could launch different agents or do different things, because we reliably know the release of the client using the different pages.

A Warning

Depending on how sophisticated your users are, there is a way around this code. Under the View menu is a Goto option. If a user has only added a database to their workspace and then went to View | Goto, they will be prompted with a list of views (either just visible views or both visible and private views if they held down CTRL and SHIFT when doing the menu option). When they choose a view from this list, that view will be opened and the database PostOpen event will not be called.