Search DominoPower's 11,437 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
A flexible approach to keeping a history of recent edits (continued)

The meat of the formula is identical for all four list fields, so if you change one, you should copy the change over to the other three as well. This part of the formula builds a list for each possible scenario--one for Append and one for Replace. If the sliding window of history rows is exceeded, it also removes the oldest row. Only one list is actually used, but computing both up front makes the formula easy to read.

DEFAULT fEHMax := 5;
rlist := @If(
n<2;
newval;
newval : @Subset( list; -(n-1) )
);

alist := @If(
n < 1;
newval;
n >= fEHMax;
newval : @Subset(list; fEHMax-1);
newval : list
);

val := @If(
@IsNewDoc;
"";
@IsDocBeingSaved;
@If(
fdEHIntervalControl = "Replace";
rlist ;
alist
);
list
);
@If ( @IsError(val); ValIfError; val)

That's about all there is to it. You may be surprised that up to this point the subform hasn't used any LotusScript, especially since some of these field formulas are pretty involved and tend to duplicate each other. I chose to stick with formula language instead of using LotusScript (in the QuerySave event) for two main reasons. In the first place, formula language is more "native" to Notes and therefore works better across both clients (Notes and Web). Secondly, all the central fields in this tool are list fields, and formula language handles lists much more intuitively than LotusScript.

The Descriptions feature, however, does use LotusScript for the Notes interface. If the feature is enabled, every editor (except the original creator) is prompted on QuerySave to describe the edits being saved. If cancelled or left blank, the save is then blocked. If a value is entered, it's placed in a hidden field named fEHDescription, which is then used as the new value for the fEHDescriptions field.

Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument, strTemp As String, item As NotesItem
Set doc = Source.Document
If (doc.fEHPrompt(0) = "1") And (doc.Form(0) <> "") Then
strTemp = Inputbox$ ( "Please enter a brief description of your edits." , "Editor History", doc.fEHDescription(0))
doc.fEHDescription = strTemp 'Create or update the fEHDescription field
If strTemp = "" Then
Continue = False
End If
End Sub

At this point, the issue of column widths becomes particularly important, since we have little control over how long an editor's description will be. To make sure that no lines wrap while preserving all the entered text, I've hidden the real fEHDescriptions field and substituted a truncated display field in the viewable table. But of course, the users will need some sort of access to the full descriptions, so I've added a formula popup to display the full descriptions when the column title is clicked:


« Previous  ·  1  ·  2  ·  3  ·  4  ·  5  ·  Next »
Other articles you might like
Home > Lotus Technologies > Application Development (48 articles)
   An application for scanning physical mail and distributing it virtually
   How hide-whens in Rich Text can ruin your whole day (and what to do about it)
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
Adding Quick Highlighter support to IBM Lotus Notes Domino Wiki, Weblog, or Webpage
Remember Young Admins...there are 2 files
WebSphere Portal 6.1.0.2 and Lotus Domino 8.5
The CKEditor - with Domino
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.

The many included activities and demos will make you a pro! Expert instructor help is a click away.

Click here to try a FREE demo course!!

-- Advertisement --

Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.

Register by April 10 to save $200.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login