Email:   
Home
In This Issue
EasyPrint
Click here for the RSS feed's XML code. This is not a browser URL.
Sorting documents via Notes and the Web (continued)

Ten Little Indians
As you probably know if you've worked with views sorted on numeric numbers before, Notes does not sort a list of pure numbers as you would expect it to (in other words, it sorts based on ASCII order of the characters themselves). For instance, Notes will sort a list of numbers from 1-10 as follows: 1, 10, 2, 3, 4, 5, etc. The way to trick Notes into behaving in a more numerically correct manner is to create a calculated column that adds a 0 in front of numbers below 10 and then sort ascending on that column. This way all of the items in a list of 1 to 99 items have two characters and will sort as desired. If you are going to have up to 999 items that will need to be sorted in a view, then you would need to add two zeros in front of numbers less than 10 and one zero in front of numbers from 10 to 99. This way every item would then have three characters and will sort as expected.

The Client
As you can imagine, sorting documents using the Notes client is very straightforward. You create two agents, one to move the selected document up (MoveDocUp) and one to move the selected document down (MoveDocDown). Then you assign buttons on the action bar to each of these agents. I've included copies of both agents in the sample database that is available at http://dan.velasco.com, so I'm not going to describe them in detail here. Instead, let's jump directly into the more difficult task of how to sort the documents on the Web. DominoPower, Ho!

A Room With a View
The secret to moving the documents up and down on the Web is in setting up a view and a view template that will enable you to select the documents you want to move and indicate if you want to move them up or down. Then you send this information to a "catcher" form that captures all of this information and then immediately runs an agent in order to change the order of the documents as you desire.

In this way, the user can just select one item at a time (a radio button) and click a checkbox to indicate if they want the document to move up or down. You can see how this all looks in Figure A.

FIGURE A

Simply select the document you want to move, indicate the direction and press the return key. Click picture for a larger image.

The view that you see above is composed of five columns with the formulas that are listed below in Table A:

Col. # Formula
1 @If(Sort_Number < 10;"0" + @Text(Sort_Number);@Text(Sort_Number))
2 Sort_Number
3 "[</center><BR><center><input type=radio name=DocUNID value=\""+@Text(@DocumentUniqueID)+"\"></center>]"
4 "[<font face=\"Arial\" size=\"-1\"><B>Move Up &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</B></font><input type=checkbox name=\"Direction\" value=\"Up\"><BR><font face=\"Arial\" size=\"-1\"><B>Move Down &nbsp;</B></font><input type=checkbox name=\"Direction\" value=\"Down\">]"
5 "[<BR><font face=\"Arial\">" + Movie_Title + "</font>]"




[ Prev | Next ]

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
-- Advertisement --

AUTOMATE LOTUS NOTES USER ID MANAGEMENT
ID Manager 4.5 from HELP Software provides a new level of automaton for managing Lotus Notes IDs. ID Manager lets Lotus Notes administrators get out of the business of creating and managing user IDs. Use our ROI calculator to see how quickly ID Manager will pay for itself.

Learn more about HELP Software products
-- Advertisement --

Six Great Tools for IBM Lotus Sametime
  • Encrypted and secure, browser-based, persistent chat rooms
  • Complete chat logging and auditing
  • Easy-to-define IM help desk queues
  • Manage buddy lists across any organization
  • Integrate awareness into Microsoft Outlook
  • High powered, rapid bot development tools


Visit Instant Tech for free trials and more information.
Copyright © 1998-2008, ZATZ Publishing. All rights reserved worldwide.
Editor's Login