No IDNA Support In Lotus Notes?

It looks like Lotus Notes does not support Internationalized Domain Names. If you want to send an email to somebody where the domainname has e.g. german umlauts you have to use a punycode encoder tool, replace the domainname with the encoded domainname string and then send it.
Otherwise the mailrouter gives you a ’no route found to domain…‘ failure.
[RFC 3492]
Online converter:
IDN Online Converter (german)


Don’t do this.

A few years ago, we missed lists in LotusScript. We decided to implement list as new object in a scriptlibrary. The methods to those listobject were similar named like the @formulas (e.g. list.implode, list.explode, list.word, list.replace etc.). Now we have a little problem because IBM/Lotus introduced some of these methods as regular LotusScript functions. You can use this scriptlibrary but you are able to do modifications in Lotus Notes 5 Designer only. If you do modifications in Notes 6 Designer you’ll get a bunch of compiler errors. The problem is that we use this listsobjects in almost every LotusScript code. We are all happy to do a little refactoring in our applications…
Uh, and…Lotus/IBM also decided not to use the ‚Initialize Event‘ in ‚Computed For Display‘ Fields. Did I mention that we use this event in some subforms ? sigh…


Error creating product object

‚Error creating product object‘ was the error message in a scheduled LotusScript Agent. If the agent was started manually it just works. The colleague who developed the agent was ill, so I had a little 911 work on a live system. I added a few print statements to the code but the agent started and stopped immediately without any statement in the console.
My fault was that I didn’t look a the very first rows of the Dim statements. The second row was ‚Dim ws as new NotesUIWorkspace‘. Uh, my old friend, this will never work in a scheduled agent.
I thought my work was done but the agent stopped again after 1000 documents of about 100.000 documents in the view.
OK. I had a closer look. The agent looped through the documents by ‚view.GetNextDocument(document)‘. In the loop a item of the current document was changed but this item was used as a view selection criteria. There again, my old friend, this will never work correct. So I changed the agent to loop through the documents by ‚view.GetNthDocument(index)‘ and increased the index variable in the loop.
Now the agent runs fine and puts the attachments of notesdocuments in the IBM CommonStore for Lotus Notes archive.
What a friday morning…


DNUG in Karlsruhe

Ed Brill hat es bekanntgegeben. Auf der DNUG (Deutsche Notes User Group, eigentlich müsste es ja GNUG heißen, aber egal…) Konferenz in Karlsruhe (10.-12.05.2004) , wird Ambuj Goyal die Eröffnungsrede halten.
Von solchen Events halte ich normalerweise nicht viel, aber da werde ich auf jeden Fall hingehen. Wenn hier schon mal so eine Veranstaltung ist.


Was es nicht alles gibt…

Freut mich doch immer wieder, wenn Organisationen die Lotus Notes einsetzen, dies auch mal zu Informationsverteilung nutzen.
Heute: Die Deutsche Bundesbank.
Bankleitzahlenverzeichnis als Lotus Notes Datenbank.


Notes 6.0 And XML

Using XML in Domino/Notes 6.0 is brilliant. After few experiments there is my first disappointement.
You can not open a URL for XML-parsing (NotesDOMParser or NotesSAXParser via NotesStream).
This is something I can not understand. Is there a reason not to implement a URL as parameter for NotesStream.Open Method ?


Object Variable Not Set

If you set a object variable be sure that it’s really set.
It’s always a pleasure for a user to get a ‚object variable not set‘ error box.

Dim session As New NotesSession Dim db As NotesDatabase Dim DecisionDoc As NotesDocument Dim strID As String Set db = session.CurrentDatabase Set view = db.GetView("(IDs)") Set DecisionDoc = view.GetDocumentByKey(id, True) Call DecisionDoc.ReplaceItemValue("ShortName","1A")
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.

Better Style:

Dim session As New NotesSession Dim db As NotesDatabase Dim DecisionDoc As NotesDocument Dim strID As String Set db = session.CurrentDatabase Set view = db.GetView("(IDs)") if not view is Nothing then Set DecisionDoc = view.GetDocumentByKey(id, True) if not DecisionDoc is Nothing then Call DecisionDoc.ReplaceItemValue("ShortName","1A") Else ErrorhandlingDecisionDoc End if Else ErrorhandlingView End if
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.


Excellent

Today I had to do some maintenance on a Lotus Notes Application. This is a software that I inherited not from a quick and dirty programmer but a more quick and more dirty programmer. This guy never ever tested his code. One function locks a section with the role „Excemption“. But the role in the ACL is „Exemption“ (for years). So you have to find all documents where this section is locked add the wrong role to the ACL unlock the section and lock the section with the right role. After all remove the wrong role in the ACL. So much effort because a simple function wasn’t tested.
Good night Germany wherever you are…


Get ‚Personal Folders On First Use‘ With LotusScript

Today I had an interesting problem. If you want to check personal folders with LotusScript you can’t get them (except your script runs local).
I did a little research in a forum on http://www.lotus.com/ldd and ‚bingo‘.
The idea behind is to get the UniqueID of the folder and then reference to it.
Function first.

Function isPrivateCopy(pnv As Variant) As Integer
‚based on code by Bruno Beauparlant and Heinrich Mueller
Dim designElem As notesDocument
Dim flags As Variant
isPrivateCopy = False
Set designElem = pnv.Parent.GetDocumentByUnid( pnv.UniversalID )
If Not (designElem Is Nothing) Then
If DesignElem.HasItem(„$Flags“) Then
flags = DesignElem.GetItemValue(„$Flags“)
Forall f In flags
If Instr(f, „V“) > 0 Then
IsPrivateCopy = True
End If
End Forall
End If
End If
End Function

Here an example code

Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim nvec As notesviewentrycollection
Set db = s.CurrentDatabase
Forall v In db.Views
Set view = v
If isPrivateCopy(view) Then
If view.Aliases(0) = „Serial“ Then
Set nvec = view.AllEntries
Messagebox Cstr(nvec.Count) & “ documents in folder“
End If
End If
End Forall
End Sub

You can find the whole thread here:
Entries in „private on first use“ folder