0

I have a view with an action button that needs to display a Prompt([OkCancelList]) and run an agent based on the selection made. The problem is I can’t get the Prompt to display. In the debugger it hits the line and jumps right to the next line. Can you display a prompt from an action button n a view? I always thought it was possible until now. Anyone have any ideas?

Sub Click(Source As Button)
    Dim session As New NotesSession
    Dim uiWorkspace As New NotesUIWorkspace
    Dim db As NotesDatabase
    Dim view As NotesView
    Dim doc As NotesDocument    
    Dim response As Variant
    Dim nonActiveDocs() As Variant
    Dim a As Integer
    
    a = 0   
    Redim Preserve nonActiveDocs(a) 
    nonActiveDocs(a) = ""
    a = a + 1
    
    Set db = session.CurrentDatabase
    Set view = db.GetView("ActiveGroupNumbersLU")   
    Set doc = view.GetFirstDocument
    
    While Not (doc Is Nothing)
        If doc.Active(0) = "NotActive" Then
            Redim Preserve nonActiveDocs(a)
            nonActiveDocs(a) = doc.GroupNo 
            a = a + 1
        End If
        Set doc = view.GetNextDocument(doc)     
    Wend
    
    If a > 0 Then
        response = uiWorkspace.Prompt( 4, "Select a Group", "Select a Group to Activate", "", nonActiveDocs)
        If Isempty(response) Then
        Else
   blah, blah, blah
RoyRumaner
  • 769
  • 1
  • 9
  • 29
  • please share your code and HOW you run it... if the agent / code runs in "backend"- context, then all frontend- interactions will be ignored... without code there is no way to answer your question. your wording seems to point to using evaluate... and that indeed is a "backend" operation.... – Tode Jul 19 '21 at 08:43
  • Have you tried your button in a test form to see how the prompt behaves there? I don't see anything obviously wrong with it, before blaming it on the context of running in a view, I'd want to make sure that there isn't something generically wrong. – Richard Schwartz Jul 19 '21 at 19:30
  • And the next thing I would try is running it in a generic, brand new view. Ever since the eclipse integration in the Notes client, some of the views in standard templates have been "special". – Richard Schwartz Jul 19 '21 at 19:32
  • It’s weird because the array is populated and the prompt function is syntactically correct. I will try it on a form just to see if it makes a difference though. – RoyRumaner Jul 20 '21 at 02:52
  • 2
    Well it wasn't actually the Prompt command. I simply forget to add (0) to the line nonActiveDocs(a) = doc.GroupNo. All good now. Thanks for the help – RoyRumaner Jul 20 '21 at 15:34

0 Answers0