I have a form in a local db with a button on it. The first thing the button action does is establish objects for the current workspace and document.It does not assign the uidocument object as it should. The third line fails with “Object variable not set”, but this is because “thisuidoc” has no value.
Set ws = New notesuiworkspace
Set thisuidoc = ws.CurrentDocument
Set thisdoc = thisuidoc.document
The variables ws, thisuidoc, and thisdoc are declared as Global variables, and are not in the declarations section of the button object.
I copied the exact local db to another machine running 8.0.2. I was able to debug without issue (under 8.0.2 designer). The program ran past these first three lines, and the “thisuidoc” and “thisdoc” objects are established.
Subject: We’ve encountered the same problem at our company
Assigning NotesUIWorkspace.CurrentDocument to a NotesUIDocument variable results in “Object Variable Not Set” when debugging.
It seems to work better when running the “basic client”. Guessing, I’d think it has something to do with the new Eclipse-based designer, since there are no problems in the 8.0.x-line.
This has been duplicated by at least 1 IBM staffer, but the conditions under which the problem occurs has not been exactly determined. It appears to be a combination of attributes that causes the problem, beyond just the database itself, and beyond the workspace folder.
Running ND 8.5 on WinXP, I tried a similarly simple code in both a local and a server-based database. I also tried both: having stored that code locally in the action button itself AND in a script library sub called from the button.
In all cases the uidoc object is built, and the backend doc object can be drawn from it:
Dim ws as New NotesUIWorkspace
Dim uidoc as NotesUIDocument
Dim docthis as NotesDocument
Set uidoc = ws.CurrentDocument
Set docthis = uidoc.Document
MsgBox "Size from local button code: " & docthis.Size
But like you, I came across another bug regarding the LS debugger itself when testing your case:
From comparing OS level copies, and copying forms into blanks databases, I suspect that some attribute of the database I’m using is causing the problem with 8.5. Such as, too many forms in the db, or something along that line. Although the same attributes in this db are no problem under 8.0.2 (C++ designer), they are a problem for the Eclipse designer. Using the form in question in a new blank database is fine. I still have an open ticket with IBM on this. I still believe there is an undeniable issue with the 8.5 designer at the core in this respect.