ICS/Lotus (mostly), Linux, Travel, Skiing, Mixology, and Random Musing of Interest

 
Bill Malchisky
 

Archives

    Find me here…

  • Skype
  • Bleedyellow via Sametime
  • A Quick Reminder Of Why Lotus Notes Development Is Awesome -- Or What I Did On My Holiday Weekend

    Bill Malchisky  September 7 2010 02:00:00 AM
    Well, after a very heavy travel month in August, including two excellent conferences (IamLUG and MWLUG), visiting new clients, plus many people being on holiday, I took the month of August off from blogging. But I did get the chance to draft several posts I am looking forward to publishing soon.

    In that spirit, I took some time over the holiday weekend to relax and get some needed rest, but also complete a few personal projects. One of which was to improve my client billing app. I wrote a Notes application a few years ago to handle project time tracking, new business requests, and payment status; it works great for my needs. But, it needed some improvements. One, was a way to send in hours via my handheld. Frustration can move mountains and after a few unpleasant hours attempting to re-create the time spent while traveling through an airport on-the-phone with two separate clients who experienced network outages simultaneously...sufficient motivation revealed itself.

    Rapid Application Development
    (RAD) has always been a hallmark within the Lotus Notes development space.
    Despite talks of moving things towards one direction or another, which direction should we be heading or not, I am pleased to state, that for many purposes, the existing tools in Notes also work well. I am a huge fan of the Lotus Formula language for starters. Yes, I know that many of my development colleagues may gasp at the thought of using it, but for many simple functions---including text list processing---a LISP-like macro language is all one needs to efficiently code and process data. I would hope that regardless of the success of new programming options for Lotus (and I am glad they exist), that there is still some consideration for these simple but effective tools that made Lotus very popular and successful. But I digress...

    Back to my project. I created a simple New Mail agent, and with what amounts to five statements: converting an inbound mail Memo document to a new form with the fields I need visible, a new view to see both the "Pending" and "Entered" documents for easy management, and one view for debugging purposes. I copied the agent into a manual Action button trigger, just in-case a misfire occurs and a document refuses to be processed down the road. Just a reminder to those that might have forgotten with all that we do on a daily basis, a few simple pieces and you can provide users with some serious capabilities, that do not require a three month window to complete. That is the power of Notes!

    The new capability's ultimate purpose allows me to be more efficient.
    While traveling when I end a phone conversation with a client, now I can create a quick e-mail addressed to my application containing the client code as the subject, enter what I did plus time spent in the body and send it from my Palm Pre. Takes just a few seconds to complete. Later, when my laptop is running, I can properly convert the new pending document(s) into the client's respective weekly billing sheet and invoice the client on-time--without looking for scraps of paper in my laptop bag or mentally recalling the events, vendors, and status of each call/action.

    The initial admin side configuration (enabling the mail-in DB), designing two new utilized views, and the agent took about an hour. The basic functionality worked the first time. Go Notes. I sent a message to the app, the database fired-off the agent, and converted the document. But like many developers, I take pride in my work, and so, I tinkered with the aesthetics a bit....well a lot. Then sent several test messages while I watched The Naked Gun 2-1/2 (It was the weekend, after all). So that took a bit more time--my choice.

    Note: to clarify the field names (in the code below); I use Abstract in the view to provide insight on what each document contains; the other fields should be self explanatory.

    Also, for my needs the code does make a few assumptions, but works great for what I seek. If I were writing it for a client, it would have a bit more error checking with agent log entries, etc. I can easily tell if the code ran...by the existence of a "Memo" form in the "By Form" view, for example.

    What I love about Notes is that this type of functionality is very easy to create.
    This is a true value-add that can take hours or days depending on the feature set to create with other languages or application environments. Notes makes providing powerful functionality enhancements and feature extensions quick. Plain and simple, it's a great product. So with a few of my colleagues companies making announcements about leaving Notes for other products, I feel for them, as at one time or another we have all seen such unpleasant (or dare I say ill-advised) decision making occur. . . whether it be with Lotus Notes or another trusted product.

    For the expert coders reading this,
    yes, the logic and agent are simple, but it works. I know it will garner a "Meh" or two. For me, the simplicity is the point as you can do a lot with one line of code with the Formula language. But I leave the serious coding to you guys/gals and happy to hire you when I need that skill level on a project. I could have also used a temp variable to store the "@UpperCase(@Trim(Subject));" construct while using upper case for all three calls to make it more efficient overall... (I am certainly not posting this blog entry as a ground-breaking theory in the development arena.)
    For admins looking at this,
    here is a good example of some simple but effective agent coding in Notes; as I teach a Dev Tips for Admins course, I enjoy providing some insight when I can.

    As I do mostly administration and architecture these days, I am happy when I get to leverage my roots every once and a while.

    Thank you for reading and I hope you enjoyed your holiday (USA) or weekend (Outside USA). Ciao...


    REM {Convert inbound document to a Pending form and put in a new view};

    FIELD Form       := "frmPendings";
    FIELD Clientcode :=
                     @If (
                        @Contains(@LowerCase(@DbColumn("":"NoCache";"";"vwClientProfileLookup"; 3)); @LowerCase(@Trim(Subject)));
                           @UpperCase(@Trim(Subject));
                        "Lookup Client"
                     );
    FIELD Resource   :=
                     @If (
                        @Contains(From; "=");
                           @Name([Abbreviate]; From);
                        @Contains(Resource; @Char(34));
                           @ReplaceSubstring(@LeftBack(From; @Char(34)); @Char(34); "");
                        From
                     );
    REM { char(34) is a quote, indicating an RFC822 formatted e-mail address; else, just show the full e-mail for RFC821 };
    FIELD Abstract   := @Abstract([NOTRIMWHITE];25; ""; "Body");
    FIELD Status     := "Pending";
    "";
    SELECT @All

    Comments

    1Victor Toal  9/7/2010 6:44:57 AM  A Quick Reminder Of Why Lotus Notes Development Is Awesome -- Or What I Did On My Holiday Weekend

    Bill! Love the idea, I usually keep electronic entries daily, but this seems easier and more intuitive for somebody who lives in e-mail all day long.

    And in the best fashion of the internet, I intend to plagiarize and pass it off as my own idea soon .. well, considering that google will give me away, I will add in small print that I appropriated the idea from this blog .... :

    2Bill Malchisky  9/7/2010 10:03:02 AM  A Quick Reminder Of Why Lotus Notes Development Is Awesome -- Or What I Did On My Holiday Weekend

    Thanks, Victor. Glad you found it useful.. and please, make the "small print" larger than a 4pt font in a non-white color. :)

    3Mat Newman  9/8/2010 2:38:25 AM  A Quick Reminder Of Why Lotus Notes Development Is Awesome -- Or What I Did On My Holiday Weekend

    Bill,

    Beautiful post that succinctly describes two amazing features of Lotus Notes:

    Rapid Application Development, and

    The power of simple Formula Language.

    Like you, I agree that this is the power of Notes. Whoever says that 5 lines of code is better than an @Command([Compose]) is an idiot, and most likely to be one of:

    "We ... are the Developers who say 'Meh'"

    4Bill Malchisky  9/8/2010 8:15:37 AM  A Quick Reminder Of Why Lotus Notes Development Is Awesome -- Or What I Did On My Holiday Weekend

    Appreciate the feeback Matt. Thanks for reading and for sharing.

    Powered by IBM Lotus Domino 8 | Lotus User Group | Get Firefox! | This blog is listed on Planet Lotus   IBM Certified

    © 2010 William Malchisky.