ND8 fix required
I was working with a customer and was made aware of a change in the way ND8 works that was breaking her pre-ND8 apps. It turns out that she somehow got forms without the compiled Lotuscript. Prior to ND8, the code was compiled when the form loaded, so no problems. Apparently. for performance reasons, ND8 doesn't do this, so the code behind the events is not found, and the form doesn't load. The fact of the missing object code is not reported by any of our design tools, but it is detectable via Lotuscript. I wrote the following bit of code to print out the forms with this problem.
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim nn As NotesNoteCollection
Dim nID As String
Dim x As Variant
Set db = s.CurrentDatabase
Set nn = db.CreateNoteCollection( False )
nn.SelectForms = True
nn.SelectSubforms = True
nn.SelectionFormula = "@isAvailable('$$Script')"
Call nn.BuildCollection
If nn.Count = 0 Then Exit Sub
nID= nn.GetFirstNoteId
Set doc = db.GetDocumentByID( nID )
Do While Not( doc Is Nothing )
If Not( doc.HasItem( "$$Script_O") ) Then
x = doc.GetItemValue( "$TITLE" )
Print x( 0 )
End If
nID = nn.GetNextNoteId( nID )
If nID = "" Then Exit Sub
Set doc = db.GetDocumentByID( nID )
Loop
Change the bolded line to point to the database you want to scan. This simply prints out the name of any form in the database that is missing the compiled object code. You may not have any, but this step allows you to be proactive in identifying this situation. I hope this is useful and helps.
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim nn As NotesNoteCollection
Dim nID As String
Dim x As Variant
Set db = s.CurrentDatabase
Set nn = db.CreateNoteCollection( False )
nn.SelectForms = True
nn.SelectSubforms = True
nn.SelectionFormula = "@isAvailable('$$Script')"
Call nn.BuildCollection
If nn.Count = 0 Then Exit Sub
nID= nn.GetFirstNoteId
Set doc = db.GetDocumentByID( nID )
Do While Not( doc Is Nothing )
If Not( doc.HasItem( "$$Script_O") ) Then
x = doc.GetItemValue( "$TITLE" )
Print x( 0 )
End If
nID = nn.GetNextNoteId( nID )
If nID = "" Then Exit Sub
Set doc = db.GetDocumentByID( nID )
Loop
Change the bolded line to point to the database you want to scan. This simply prints out the name of any form in the database that is missing the compiled object code. You may not have any, but this step allows you to be proactive in identifying this situation. I hope this is useful and helps.
Category Notes 8 Lotus Notes Application Development Development Tips and Tricks Upgrades
Comments
Please forgive my ignorance: it's been a long while since I've done any Notes Dev but what is "compiled object code"?
Just wondering if this should trouble us: we had happy auditors when we showed them the result of the TeamStudio upgrade filters, but did we miss this trick?
Many thanks!
Richard
Posted by Richard Baker At 09:44:36 AM On 01/15/2009 | - Website - |
Posted by John Kingsley At 11:30:52 AM On 01/15/2009 | - Website - |