Debug LotusScript and NotesUIWorkspace Regression SPR# **SODY7NRJES... its back!


Domino/Notes Version: 14.0FP4
Add-on Product (if appropriate, e.g. Verse / Traveler / Nomad / Domino REST API):
Its Version:
Operating System: Win 11
Client (Notes, Nomad Web, Nomad Mobile, Android/iOS, browser version): Notes


Problem/Query:

< PR # SODY7NRJES fixed in 8.5.1 release

SPR# SODY7NRJES - Prior to the fix, the LotusScript debugger did not always show values for Current.Document and CurrentDatabase for the UIWorkspace class. Now,when the LotusScript debugger executes code in an environment where CurrentDocument and/or CurrentDatabase are valid, the debugger will show the correct values for those properties.>

This is back in Version 14. Debugging LotusScript Code is temperamental at best at worst is fails.

This simple code in an Action button or hot spot will run fine in the Notes Client. But when the Debugger is on the Code fails at Set doc = uidoc.Document

Messagebox "hello" , MB_OK , "test"

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIdocument
Set uidoc = ws.CurrentDocument

Dim doc As notesdocument
Set doc = uidoc.Document   ' <--- Object not set when debugging

Messagebox "hello 2"  & Doc.Form(0) , MB_OK , "test"

This is a right PIA when we need to debug code further down.

Hi @JazzIT,

Please submit a support case so that we can further review this issue. Thank you.

1 Like

OK. So we have done some more testing and found the problem!

The form we are using has an embedded view to display the response documents of the Main document.

The code in question is in an Action Hotspot on the Main Form and used to manipulate the current Main document in edit mode.

With Active Debugger:
If the Main document is opened in Edit mode and there ARE documents in the Embedded view then Debugger runs fine. Ws.currentdoucment contains the current Main document.

However, if the Main Document is opened in Edit Mode and there are NO documents in the embedded view the Debugger fails as there is nothing in ws.CurrentDocument.

IMPORTANT NOTE: The code always runs correctly when the Debugger is not used.

It seems the Debugger cannot get ws.CurrentDocument set correctly if there are no documents in the embedded view. It does not get a handle on the current UI Workspace.

Furthermore. When the Debugger fails and you press CONTINUE and return to the current Main document, still open in edit mode. Then, press Hotspot to run the code again with the Debugger still active. The Debugger runs fine, and WS.currentdocument is set correctly.

Further testing, clicking anywhere in the Main document or changing values, even saving the main Document before pressing the Action HotSpot with the Debugger active, makes no difference; the Debugger still fails as before.CurrentDocument. is not set.

So, this is why the issue is temperamental and did not appear to be consistent. Well, it is consistent, just in very specific circumstances.

There is definitely a bug in the Debugger code. But I suspect this will become known as a “Feature” of the Debugger.

I am guessing it has been around forever. However, I cannot test pre-V14