Buttons
3 minute read
Use and Properties
Buttons can be used to implement additional user-defined features directly on Docusnap data entry screens. For this purpose, either external applications with corresponding parameters may be started or VB scripts may be executed. In both cases, the data from the current record will be available and may be integrated into the corresponding program call or the script. To load the desired data, enter the corresponding database column names in braces in the following format: {FIELDNAME}
In addition to the global properties, the following property settings are available for buttons.
Specific Properties of Button Controls | |
---|---|
ActionMode | This property determines the type of action to be executed. The available options are Application or Script. When you select Application, clicking the button will start the application specified in the Application property. Additional parameters can be indicated by means of the AppArguments property. When you select Script, clicking the button will execute a VB script that you define through the Script property. The unselected option will automatically be ignored by Docusnap. Settings you have made for the currently disabled option will not be considered. |
Application | Here, you can specify the application to be executed when the button is clicked. This requires that the Application option has been selected for the ActionMode property. Enter either the name of the application, such as explorer.exe, or the full path to an executable file on the hard disk or on a share. |
AppArguments | Using this property, you can define additional arguments that will be passed as parameters to the application to be executed when the user clicks the button control. As with the Windows command line, multiple parameters can be entered. It is also possible to use data from the current record by entering the respective field name in braces. |
Script | In this property, you can specify a VB script to be executed when the user clicks the button. Here again, data from the current record is available without restriction. You can integrate it into the script by entering the respective field name in braces. |
Examples of Use
Opening an Admin Share
Specify the following to enable a user to open the C$ admin share of a Windows computer by clicking a button on a Windows systems level data entry screen:
Property | Value |
---|---|
ActionMode | Application |
Application | explorer.exe |
AppArguments | \\{Hostname}\C$ |
Starting a Remote Desktop Connection
The configuration below enables the user to start a remote desktop connection for the current computer from a data entry screen at the device level.
Property | Value |
---|---|
ActionMode | Application |
Application | mstsc.exe |
AppArguments | /v {Hostname} |
Simple VB Script Example
The simple example of a device level script shown below checks whether the currently selected computer is online or unreachable using a ping command.
Property | Value |
---|---|
ActionMode | Script |
Script | Dim Win Win=“select*from Win32_PingStatus where address=’{Hostname}’” Dim Level Level = “winmgmts:{impersonationLevel=impersonate}” Set objPing = GetObject(Level).ExecQuery(Win) For Each objStatus in objPing If IsNull(objStatus.StatusCode) Or objStatus.StatusCode<>0 Then WScript.Echo “Computer {Hostname} is unreachable.” - Else - WScript.Echo “Computer {Hostname} is online.” - End If - Next |