Thursday 29 March 2007

Slapping code together only works if you review before roll-out

Some Notes Developers do leave a little to be desired and with my two tame Notes Developers out in India, they do tend to come up with some real gems. Todays classic was found only as I was testing out some of the moduiles from Ytria's Suite of Tools.
Input Translation and Input Validation are two areas that some people struggle to understand, I know back in the day I have written some bizarre code there. Anyway this is a classic, the field is a Dialog List, picking up the options from a view in another database, which the developer has added a sort option to, you are not allowed to select multiple values. So when you have selected your single value, the following Input Translation runs.....

@Sort(@ThisValue; [Ascending])

It looks as though he originally attempted to sort the return from the view for the dialog list by adding the Sort to the Input Translation. Thanfully this has now been pulled from the code, thanks to Ytria again for that one.

For those of you just starting out :-

Input Translation = Change the value that I have just entered into the field
Input Validation = Check that the information I have just entered in the field is correct and point out if I have been a prat!!

Wednesday 28 March 2007

A Minor annoyance

If there's one thing that does annoy me about Notes as a Developer (Yes I know this is the Lotus Notes Rocks blog, but it's not perfect, just accept that) a it's that some of the Lotusscript commands don't work as I feel they should.

The command that has caught me out today, not for the first time as well, is the view.GetDocumentByKey command. This seems like a fairly simple command and it is, it is very useful and I use it all over the place, however it does have what I think is a logical flaw. If you have a view containing a number of documents with the first column containing say a Town Name and this column is sorted.
Lets say we have a number of Documents covering various towns,
  • High Wycombe,
  • Reading,
  • Marlow &
  • Marlow Bottom.
I then run an agent to get me the Marlow entry, using the command view.GetDocumentByKey("Marlow") and lo and behold we now have the Marlow document. However down the line, the Marlow document is removed from the system, at from then on when the agent runs you would expect it to return some kind of error that the Marlow document no longer exists, however given the way the command has been built, by default it will accept a partial match and therefore returns the Marlow Bottom document.

Now there is a boolean parameter that sits on the end that will force it to perform an exact match, however by default a partial match is enough. For the novice developer this is very dangerous and I can speak from experience that it can cause major problems if you don't spot the need for the exact match.

An agent I wrote that went through a database each time a new document was created, checked against a particular number on the document to see if the doc number already existed with the same revision that the new document had and if there was such a document it was removed, as this new document was obviously supposed to overwrite it. For many weeks we tried to understand why sometimes documents with a zero on the end of the document number, went missing. Of course we eventually spotted the extra parameter and realised that if you created a Document 12345 Revision 1, if it didn't already exist in the system and Document 123450 Revision 1 did, that 123450 document would get removed.

That was the first time it caught me out and todays was the second hopefully I will remember to add the parameter every time from here on and there will never be a third!! So there you go, the first gotacha that you need to look out for if you are just moving into Lotus Notes Development.

Tuesday 27 March 2007

Who am I.

Well I guess the obvious question after why we are here, is who I am.
I have been working with Lotus Notes on and off for about 12 years, firstly on and off as a Lotus Notes administrator, starting with Version 4.5 and later Version 5 and then for the last 6 or so years as a Notes Developer, Version 5 to date.
Programming is something I had enjoyed fiddling with back about 15 years ago but had never really considered it something I could make a career out of, and it was somewhat of a lucky, at least for me, break that landed me a transfer within a company from Admin to Developer and from there things have taken off.
Technology wise I mainly deal with Ver 6 and 7, although I have downloaded the Ver 8 beta, I also work with Sametime, Quickplace (or Qucikr as it's soon to be), Lotus Discovery Server (for my sins) and it's replacement Omnifind enterprise edition from the Websphere family. So there are I am sure a lot of topics to talk about.
This is an open forum so if you want to talk please raise you hand and type a comment. Feel free to criticise any products listed above, I am the first to admit they are not perfect, but do keep things sensible, for those of you who find my other blog I am sure you can understand.

Kind of inevitable really

Well I have been messing about in the blogging arena for sometime, the usual rubbish that people write over at ChairboyRules, I attempted to keep a Film & TV blog going over at Entertainment from the Chair, but that one died due to me not watching enough quality entertainment!!!
So that brings us here, and where is that I here you ask, well here is kind of what I thought I was originally going to blog about, Lotus Notes, however my original blog never rose far about, what I did this weekend. This blog will be purely Lotus Notes, I can't promise to blog everyday, but I will blog whenever I find something useful to write about, that may be a new coding trick, comment on an announcement from Lotus or even linking through to another of the quality blogs in the Lotus arena.
First things first though, can I introduce you to the list of websites and blogs on the right, I am not saying that they are the best Notes websites and blogs, but they are certainly the ones that I find myself reading most of the time and therefore make up the first entries in my blog roll.