Forum Discussion

AndreaF's avatar
AndreaF
Contributor III
2 years ago

Interactive prompt

Hi all,

it is pretty straight forward in an dashboard extender rule to return a message box to be displayed to the user in the dashboard (like the picture below).

The question I have is: is it possible to prompt the user with what I would call an interactive prompt, a prompt having a Yes and No buttons for example, and for the dashboard extender rule code to store the result of the selection for use in the rule code itself?

 

This would be useful when displaying a warning for example. We could prompt the user with the warning and then ask if they still want to proceed or not.

 

Thank you

  • Yes, its possible but will require building out a custom dashboard that displays when triggered. Many marketplace solutions have examples of this (example is in People Planning, Thing Planning, Capital planning, etc). When you click on any of the buttons on the top of those solutions tool bars, such as the delete register 'X' button, you will see a dashboard display. This allows you to entirely customize the look and feel of the prompt.

  • Yes, its possible but will require building out a custom dashboard that displays when triggered. Many marketplace solutions have examples of this (example is in People Planning, Thing Planning, Capital planning, etc). When you click on any of the buttons on the top of those solutions tool bars, such as the delete register 'X' button, you will see a dashboard display. This allows you to entirely customize the look and feel of the prompt.

  • ChrisLoran's avatar
    ChrisLoran
    Valued Contributor

    You need to remember your business rule will run on the server, in the cloud.
    Not on your laptop/PC.
    So MsgBox statement running on a server machine in an Azure cloud, isn't going to present a popop on the client laptop.
    The MsgBox would work in Excel because the process actually runs on the client laptop/PC.

     

    As per Rick's response, many Marketplace solutions do indeed prompt for confirmation Yes/No questions by using a simple Dialog popup in the form of a dashboard which is configured to show when a button is clicked.

  • AndreaF's avatar
    AndreaF
    Contributor III

    What about using the MsgBox function? Has somebody tried to use it in an dashboard extender rule?

     

    Private Sub PromptYesNo(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardExtenderArgs)
      Dim Msg As String = "Do you want to continue?" ' Define message.
      Dim Style As MsgBoxStyle = MsgBoxStyle.OkCancel ' Define style.
      Dim Title As String = "MsgBox Demonstration" ' Define title.
      Dim Response As MsgBoxResult = MsgBox(Msg, Style, Title)
      If Response = vbYes Then 'User chose Yes.
        'Perform some action.
      Else 'User chose No.
        'Perform some action.
      End If

    End Sub

     

    When trying to run the above Sub via a dashboard button I receive the following error message:

    "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application."