Monday, 26 May 2008

Lotusscript NotesDateTrouble

The other week marketing requested a function (agent) to send a follow up email x days (follow up days) after recieving a document (an order in this case).
Not a difficult function to build and NotesDateTime gives us the properties and methods to determine if a document is more than x days old.
So I build the agent that compares the created date of a received document to the date of today, both transferred to a NotesDateTime class. For the today value I used the "today" function. The agent will run once a day at appr. 14:00 hrs.

Sample of the code (simplified for ease of reading)
Dim dtToday As NotesDateTime
Dim dtCompare As NotesDateTime
Set dtToday = New NotesDateTime ( Today )
Set dtCompare = New NotesDateTime ( Now )
If dtCompare.LSLocalTime <= dtToday.LSLocalTime Then
...Print 'compare date is less-equal today, send follow up'
End If


All seems to works fine if you work with documents that are older than a day (x > 0), but when we wanted to test if it worked when x = 0, no follow up emails were send.
In the sample code above I replaced the created date by "Now" but the problem is in the "Today" function.
Only when inspecting the assigned values in the debugger, you can see why it doesnot work. The "Today" function doesnot set any time value in the NotesDateTime class (see the screenshot), but in the comparison it seems to assume a time of 00:00:00 (the start of the day) and thus the follow up is not send.

To solve the problem setting dtToday to "Now" is an option, but will only partially solve the problem as it will ignore documents received after the time set by "Now" until the next day.
So instead I decided to set dtToday to the end of the day by combining the "Today" function with a fixed time string of "23:59:59".
In the (simplified) code below you can see how it works.



Set dtToday = New NotesDateTime ( Today & " 23:59:59" )
Set dtCompare = New NotesDateTime ( Now )
If dtCompare.LSLocalTime <= dtToday.LSLocalTime Then
...Print 'compare date is less-equal today, send follow up'
End If


The message I want to give here is when using NotesDateTime comparisons, carefully look at the values displayed in the debugger to see if it works the way you think it should work.
Initially I did not do this and was puzzled as to why the comparison did not work until I started looking at the assigned values of the classes in the debugger.


Wednesday, 21 May 2008

CIAO! - end of june is here

Two weeks ago I posted a warning about a bug in TeamStudio CIAO! where all checkout comments would be lost when checking in a group of design elements.
In this post I mentioned that TeamStudio gave me an e.t.a. for the fix by the end of june.

But with the end of june still six weeks away, this monday I found an email in my inbox notifying me the bug has been fixed in edition 24a.
I have installed this edition yesterday and indeed the bug is fixed.

Good work TeamStudio, it is so much easier again checking in a group of design elements rather than one by one.

Thursday, 15 May 2008

I won (IBM Lotus Technical Conference in Amsterdam)

You probably know the feeling. Entering yet another raffle to win a nice price, but somehow the price always goes to someone else.
I had the same feeling when I entered a draw held by the SNUG (the Dutch user group for IBM software) for tickets to the IBM Lotus Technical Conference in Amsterdam, featuring Alan Lepofsky. I only had to answer three not too difficult questions which could be found on their website. Obviously I did not expect to win, but to my big suprise this morning I received an email from the SNUG to let me know I won (woehaa!!).
So on 2 and 3 june I will be in Amsterdam and maybe I will meet you there.

More details about the conference can be found at link to the conference above.

Tuesday, 6 May 2008

Warning for TeamStudio CIAO! users !!

If you are using the TeamStudio Edition 24 CIAO! tool, please be aware of the following bug:
When checking in multiple design elements and ticking the "Use check out comment" option, the check out comments are "erased" and gone is your history.

As a workaround you will have to check in all checked-out design elements seperately !!

This bug has been reported to TeamStudio. However the fix is not expected to be ready until the end of june.

Monday, 5 May 2008

New functionality and look & feel for Lotus forums. Q: when IBM ?

Ever since I attended the BP203 session at Lotusphere, "A look under the hood of a world class IBM-Lotus web application", everytime I go to the Lotus forums I expect to see the new look and feel presented.
In this BP203 session Scott Good and Henry Newberry of Teamwork Solutions inc., showed what they had build on request of IBM to get the forum look & feel and most importantly the performance into the web 2.0 era. The solution Scott and Henry presented was stepping away from full roundtripping for every page to making the best use of AJAX and JSON in building the pages.
During the presentation Scott hinted to some legal issues with IBM that where blocking a roll-out, but by now I would have expected that to be solved.

I have no commercial attachment to either party, nor do I know what the status of the issues are.
But here is my plea: go ahead IBM and suprise me the next time I go to the forums to participate to see this new functionality.