Search DominoPower's 11,441 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)

I also focus heavily on embedded documentation in my tools, because it can be maintained and distributed along with the tools' design elements; because developers are much more likely to read it than a separate technical document; and because my own poor memory needs as much help as it can get--even during the initial development process. The hidden collapsed section titled "DESIGN DOCUMENTATION" contains the high-level information a developer needs in order to install and use the tool. More detailed documentation is provided for some individual fields via REM statements in their value formulas.

The design breakdown
In a reusable subform, formatting and other customizations should be pushed to the host form whenever possible. The Editor History subform intentionally doesn't include a title, collapsible section, or background color, in order that these may be customized to the host form without modifying the design of the subform. This is a huge priority when building a reusable tool, because all installations of a tool should be identical if at all possible. If you can successfully standardize your tools and maintain them from a single design template, you can distribute bug fixes and enhancements through simple design refreshes, instead of through tedious manual updates to each version.

In this tool, several customizations can be controlled by creating special interfacing fields on the host form. The simplest example of this is the line of additional instructions displayed at the bottom of the subform. By default, the fdEHDesc field computes to null and displays nothing, but if the host form has a field named fEHDesc, it will display that field's contents instead. Here is the formula:

DEFAULT fEHDesc := "";
fEHDesc

This is all very simple, thanks to the formula language's built-in DEFAULT keyword. The formulas that reference the other optional setting fields (fEHMax, fEHInterval, and fEHPrompt) generally use the same approach.

Now, let's look at the simple fields that compute during document creation and the initial save. The fdEHMax field is purely informational and works the same as fdEHDesc, so it requires no special attention. Next are the two fields in the "Created By" row, which store the name of the document's original creator and its creation date. They are fairly ordinary computed-when-composed fields that compute to the current user's name and the current time.

This is simple if we assume the Editor History subform will be included in every application from the very beginning, but what happens if the subform is added later and then used with pre-existing documents? For older documents, the fEHCreated and fEHCreator fields should use the original creator's name and creation date, not the current editor and time. So, these two fields' formulas are set to handle both new and old documents:

fEHCreator:
val := @If(
@IsNewDoc;
@UserName;
@If ( $UpdatedBy != ""; @Subset ($UpdatedBy; 1); "")
);
@Name([CN]; val)

fEHCreated:
@If(
@IsNewDoc;
@Now;
@Created
)


« 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
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> 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