This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Jul 23, 2014, 8:07 AM
4 Posts
topic has been resolvedResolved

MessageBox Statement ignored

  • Category: Application Development
  • Platform: Windows
  • Release: 9.0.1
  • Role:
  • Tags: MessageBox
  • Replies: 4

Hi

we have many databases created from the same template.

There is a shared action on selected documents (Set collection = uiview.Documents). 

The shared action calls a function in a script library:

 

Function myFunction(destdb As NotesDatabase) As NotesDocument
    
    'Globals
    'ws As NotesUIWorkspace is declared global in the library   
    'Locals
    Dim view As notesview
    Dim acoll As Notesdocumentcollection        
    Dim vName As String
    
    On Error Goto ErrorRoutine
    
    ok=Msgbox("My first Question?",4+32,"First Question Title ?")        
    If Not ok=6 Then            
        ok=Msgbox("My second Question?",4+32,"Second Question Title ?")                
        If ok=6 Then
            ....
        Else
            vName, = "MyView"
            Set acoll = ws.PickListCollection( 1 ,False, destdb.Server, destdb.Filepath, vName, "Title", "Please select a document"" )
            ...
        End If
    End If                
    ...

End Function

 

For a short time in two of our databases both msgbox - lines are simply ignored,

also the debugger jumps in the line but nothing happend and next line will be executed.

So it always continues the ws.PickListCollection >> This works. 

I tried MessageBox instead of MsgBox, but it makes no difference.

Also noticable: opening the database it comes with a left frame containing an outline and a right frame an empty page.

The action is a button in a view (uiview) and normally if the action was finished it returns to the view, but

in the concerned databases it changes the right frame to the empty page??

Any idea?

 

Jul 24, 2014, 9:36 AM
107 Posts
Did you try...
...deleting your local Cache.NDK file (while Notes is down)? I've seen cases where this remedy worked wonders.
Jul 25, 2014, 3:40 PM
12 Posts
What happens if you access the view directly?
If we bypass the frameset in the DB we are seeing the issue for and just access the view with the button in it directly,  does that allow the MessageBox to work correctly?
Jul 25, 2014, 5:56 PM
1 Posts
Tested it and in my testdb it works perfectly...

I've tested this script several times and it will always work as designed. I suspect that there is something else going on that isn't shown in your code; 

1) The variable "ok" isn't declared and it can cause problems.

2) You are using global variables and that is simply bad design. I'm not going into big details about global variables but do google it and You will find out why.

3) I would replace the "4+32" with the constants defined in LSCONST.LSS; Replace "4+32" with MB_YESNO + MB_ICONQUESTION and the "6" with IDYES and "7" with IDNO and then also change the logic of the if-statements; 

4) I try to avoid using the "NOT" statement - it makes code harder to read and understand. Always test for the result that You are expecting and that will trigger the if statement - not the opposite:

If ok = IDNO Then ...

is far more readable and understandable than 

If Not ok = IDYES Then...

hth

Jul 28, 2014, 10:06 AM
4 Posts
MessageBox Statement ignored - Solution

hi, thank you very much for all tipps.

Before the function was called from the shared action another function will be called.

Inside that function I have a loop where I called a  session.getdatabase(server, path, false) from a  server not existant any longer.

I think it was a sort of session timeout/break (???) who eliminated my messgebox statements.

So Kenneth was right, it was no good practice to use global variables: in this case the NotesSession and NotesUIWorkspace.

Heinrich

 


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal