Your Development & Design Resource
Adding Admin-defined Color-coding to Lotus Notes View rows via Color Profile Documents
01/05/2009 10:47:00 AM by Chris Toohey
While working on the Public Build Event Calendar project, I found myself adding two things to the application that I thought might prove useful to Lotus Notes client developers. The first I'll discuss today when we cover how you can use a simple Profile document to apply View row color-coding logic to your Lotus Notes applications.
For those if you who are -- like me -- more visually minded:
I'm using my Preferences example application as my springboard here, which will allow me to easily:
Define a runtime formula that will evaluate against the NotesDocuments in my color-coded NotesView in my "Preference" NotesDocument through a combination of
Textfields to store my templated Formula and my
@ReplaceSubString-evaluated runtime formula.
The runtime formula Formula is then written into a Profile NotesDocument (which I've named "colorprofile"), into a NotesItem on that Profile NotesDocument (which I've named "colorstatus").
In my target NotesViews, I create a hidden ViewColumn, specifying that this column is to "Use value as color", that it is "User definable", and that "Profile Document" that holds the runtime formula for the Color-coding matches the same name of my Profile NotesDocument ("colorprofile").
Additionally, on the Advanced tab in the Column Properties, I make sure that the Programatic Name of said Column matches that of the defined NotesItem on the "colorprofile" storing the runtime formula I wish to use for this particular NotesView (ie., "colorstatus").
I then specify a simple Formula for the Column that will allow me to (should I choose) specify a unqiue color scheme. In this case, I'm using
Now, at runtime, my runtime formula is evaluated and the color-coding applied to my NotesView!
For those of you who -- again, like me -- prefer a hands-on demo:
The aforementioned second topic - which I'll try to get out tomorrow - will have us creating a simple Calendar-type NotesView, and using the RegionDoubleClick Event to pre-set the Starting Date and Time of a new NotesDocument based on your location/region at the time of your double-click! This approach is discussed (and used) in the Event Calendar Public Build project (Episode 2, I believe) - so if you want to you can check that out now!