Adding JavaScript Code for External Application Configuration
The following procedure shows you how to add JavaScript code to configure a button for an external application.
To add JavaScript code to configure a button for an external application
- Start the Admin application.
- Click Map settings on the vertical navigation bar, and then click Module Settings.
- Click the icon marked Quick Action.
- On the Quick Action Configuration opens, click either 'Add' under External App Configuration or 'Edit' next to an existing definition in the External App Configuration list.
- In the dialog box that opens, enter the following information.
- Name - This is a text field. Enter a label that will be displayed on the button.
- Action - Choose the action desired: Custom Action, Quick Call, External App.
- Display as HTML - Allows HTML to be used. you may also upload from a separate location.
- Image Icon - An icon to display for the Action on the device.
- Expression - Enter the JavaScript code in the Expression input box. Note that the event handlers must be the first methods mentioned in the inline JavaScript code in the Expression input box because the first methods are automatically registered as the event handlers. Any event handlers that are stored in libraries will not be called.
- Click Save to complete, or the 'X' to exit without saving and return to the Module Settings screen.
Table 5. describes the filters that you can configure for quick action buttons and shows the supported event handler.
Table 5.Quick Action Buttons: Supported Event Handler
Quick Selector Filter Type | Description | Available Events |
Open External Application | The external application is called by the defined Open External Application button, which constructs the URL to invoke for the external application. If the event handler is present, other settings such as the application URL (App URL) and application command (App Command) are ignored. | openExternalApp |
For more information about JavaScript and buttons, see Using JavaScript to Invoke Actions in Swift MEAP™