Scripting - Thin Client - Display a message box
Issue
How to display a message box in thin client validation / verification?
Solution
The command MsgBox only works on rich client as it calls the basic method to display a window. The same happens in thin client validation but: the window is shown on the server in an invisible area. As the window cannot be closed by a user the process waits all the time.
At the moment there is no extra command to show a dialog box in the browser. Enhancement Request 563819 already exists.
There is a workaround to use the err.raise command like this:
Err.Raise(777,"Script","<br><br><br><br><font size='+1'>Hello world!<br>Thank you!</font><br><br><br><br><br>")
If this is called in script, e.g. when a button is pressed, then this will be shown to the user:
The code to display a message and to consider, if it is executed in thin client or rich client could look like this:
Public Sub MessageBox(Text As String) If Project.ScriptExecutionModuleType=CscScriptModuleTypeThinClient Then Text=Replace(Text,vbCrLf,"<br>") Err.Raise(777,"Script","<br><br><br><br><font size='+1'>"+Text+"</font><br><br><br><br><br>") End If MsgBox(Text) End Sub
Please keep in mind that it is only a workaround and may not work in all script events and it may not work or cause problems in newer versions. If possible try to use validation methods first.
Level of Complexity
Easy
Applies to
Product | Version | Build | Environment | Hardware |
---|---|---|---|---|
Kofax Transformation Module | 6.x |
References
additional keywords: dialog, information,