Search DominoPower's 11,408 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.
Using one template for three different uses (continued)

DB := @LeftBack(@UpperCase(@Subset(@DbName; -1)); ".NSF");
group := @Trim(@RightBack(DB; "QADISC"));

S := "555-1111";
H := "555-2222";
D := "555-3333";

@If(group = "S"; S;
group = "H"; H;
group = "D"; D;
"")

Let's break down the code in segments. First, you'll need to figure out which database group you're working with. Set a temp variable, DB, to be the filename name, minus the ".nsf" extension. Note that you have set the filename to uppercase. This is done so that this database may be named "qadiscs.nsf" or "QADISCS.NSF" or any case combination, and the code will still work properly. Here's the code to make the name uppercase:

DB := @LeftBack(@UpperCase(@Subset(@DbName; -1)); ".NSF");

Then set a temp variable, group, to be the group name, which is really the filename stripped of the common characters, "QADISC". Given that you set the filename to uppercase in the last line of code, this text needs to be uppercase as well.

group := @Trim(@RightBack(DB; "QADISC"));

Next, you'll need to account for each group within QA, so let's set some temp variables for each contact phone number:

S := "555-1111";
H := "555-2222";
D := "555-3333";

From there, simply match the group with the contact phone number:

@If(group = "S"; S;
group = "H"; H;
group = "D"; D;
"")

This code or a similar variation can be used for a variety other functions, like formatting sequential number fields, in computed subforms, or behind buttons to load up a specific form depending upon the database (or group) name.

Why do it this way?
The main advantage to using one template instead of three would be maintenance. Should the customer come back with sweeping design changes, it would be easier to configure and maintain one template, rather than three flavors of the same basic design. Also, the code and naming convention are rather easy to understand and use; there's no rocket science here. The keys to using this technique are planning the design given the audience it is to serve and being sure to document where this code was used in the design. With proper documentation it would be a simple task to add support for another group -- say "Web Quality Assurance" -- from this template.

Chris Brown is a Notes Developer currently based in the Washington, DC Metro Area. Due to her rather common name, Chris is better known as her alias, Green Jellybean, which is the nickname for her green Toyota RAV4. She can be contacted at green_jellybean@bookideas.com.


« Previous  ·  1  ·  2
Other articles you might like
Home > Lotus Technologies > Notes (84 articles)
   A walk down Memory Lane with Lotus Notes
   An application for scanning physical mail and distributing it virtually
   Managing Notes deployments with Teamstudio Build Manager
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
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
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
Five trends for 2010
Latest Lotus Headlines
Quickr Domino 8.2 Fix Pack 10 is available
Sametime Business Cards: Where's that Picture Coming From?
How to let users define their own default font for Rich text fields
Lotus Technical Information and Education BlackBerry Jam
Spilling the beans on Thursday's webinar
Free webcast: Troubleshooting SMTP in Domino - exclusive early registration!
Folks, don't network share your Domino server directory
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Make Mafia Wars an offer it can't refuse
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Removing an Office installation that doesn't want to go away
-- 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 December 31 to save $350.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login