OnBase has always tried to keep users informed when events occur within the system. The Unity Client is no exception to this rule. In fact, you have probably noticed that every time a custom script is executed that you receive a notification that a script has been run. This notification typically displays in the bottom right-hand corner of the screen to inform the user that whether a script has successfully executed or failed with an error. However, the message that is displayed may not be entirely useful to the end-user and may be ignored because they may not know what to do with it or even know what it means.
Well, in OnBase 16, the notification; otherwise known as ‘Status Window’ or ‘Toast Popup’; can be modified to display a message of your choosing. Or better yet it can be disabled completely from being displayed.
Using this new feature is extremely easy. In Unity Automation scripts a new object was added to the script arguments called “StatusMessage” which contains two (2) properties. The first property, “Enabled”, is a Boolean that provides control of whether the notification displays when the script is complete. Setting this to false will suppress the notification. The second, “Message”, is a string allowing the ability to display a custom message in the notification window. If this property is not set, the Unity Client will still display the notification window but will populate it with default text from the Unity Client. Finally, the message has a maximum length of 255 characters; anything beyond 255 characters will be truncated.
Accessing this new functionality can be done through the existing script arguments.
args.StatusMessage.Enabled = true;args.StatusMessage.Message = "This is a test";
The example here will end up producing the toast contained in the screenshot above.
Below is a list a scripting interfaces where this new feature is available.
Document Scripts:
Scanning Scripts:
Indexing scripts:
GlobalClientScript
This new functionality provides more control over what can be done when utilizing the Unity Automation API. By controlling the script notification, you can now be more informative and provide useful information when building both simple and complex solutions. This will also provide the ability to display more comprehensive messages to the end-users to help them understand what exactly they may have just done in the context of a script execution.
Next week, we'll be looking into the configuration of your Unity API integrations in OnBase Studio. For any questions and comments, be sure to send us a message either through our comments section or the forums.