When creating a dashboard that requires user interaction, usually it is necessary to receive confirmation from the user to proceed or we just want to inform the user that something has happened in the background.
In order to do so, one of the most efficient ways to do it is by displaying a dialog box from the code with the information that we want to share with the user and, if necessary, some buttons to catch the user response.
However, I still haven't found this way to do it while programming a Business Rule in OneStream. Since it uses VB seems that using the "MsgBox(<message>)" function should work, but the following error occurs:
Summary: 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.
When using MessageBox.Show() with the "ServiceNotification" option, then it doesn't trigger an error but it doesn't display the message box either.
Therefore, the most easy-to-go option seems to be throwing an error with the message that you want to display, but when the purpose of the message is just to inform the user it doesn't seem the correct approach.
Another approach would be creating display a dashboard component as a dialog box, but it is not a very practical solution.
What is the best approach you have used to serve the purpose of displaying a message box to the user?
@ogonzalezAssuming the following scenraio -
3. Dashboard2 ->
When the user clicks on Button_Execute, You can put Dashboard2 under 'Dashboard to show'
Thanks for your reply @OS_Pizza .
I agree this could be an option for some purposes altought it mean to create specific components for the dashboard, what I was referring to is to prompt a message box from the business rule code, such as it happens when you throw an error message, but without the message being an error and killing the execution.
You've mentioned a couple of different requirements but the most basic "Message Here. Click OK" dialog box can be quite easily achieved. There is some sample code in there already when you create a new dashboard extender rule. The code looks like the below. I chopped and mashed some stuff together from something already written but you should get the picture:
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardExtenderArgs) As Object Try Select Case args.FunctionType Case Is = DashboardExtenderFunctionType.LoadDashboard If args.FunctionName.XFEqualsIgnoreCase("setComponentValues") Then If args.LoadDashboardTaskInfo.Reason = LoadDashboardReasonType.Initialize And args.LoadDashboardTaskInfo.Action = LoadDashboardActionType.BeforeFirstGetParameters Then Return nothing End If End If Case Is = DashboardExtenderFunctionType.ComponentSelectionChanged Select Case args.FunctionName Case "something" Dim selectionChangedTaskResult As New XFSelectionChangedTaskResult() selectionChangedTaskResult.IsOK = True selectionChangedTaskResult.ShowMessageBox = True selectionChangedTaskResult.Message = "Hello World. Click OK to continue." Return selectionChangedTaskResult Case "somethingElse" Return nothing End Select End Select Return Nothing Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Function
Thanks for your reply @DanielWillis .
I wasn't aware of this way to display a message, however, it is not exactly what I'm looking for. What I'd like is to be able to use the MsgBox function (https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/msgbox-function) from VB (or an alternative that provides the same functionality) so I can display a message to the user the same way I throw an error, but without it being an error and killing the execution.
Is there any update on this, I am also looking for a similar approach. I want to show a message box to user when a condition is met in a Dashboard XFBR String and want to return something after the message is prompted.
Daniel gave you an example on how to do this. You cannot use vb message box feature in Onestream. You will have to use a dashboard and show a message there. Nick, for your use case, you'll have to move your XFBR logic to a dashboard extender rule and then show the message.
I know this is possible in a Dashboard Extender.
I my case, I am using a BRString() in a Data Adapter and expecting a value in return and an error message to pop up if a certain condition is not met.
If there was a sole purpose of showing the dashboard, I could have refereed the XFBR logic to the Dashboard Extender. But I don't think that is possible in this case.
This makes sense. I can attach the Dashboard Extender in Server Action in the Cube View (Component) embedded in the Dashboard and Replicate the condition to show and message in a Dailog/Dashboard.