How to configure Form Actions
There are three types of Form Actions that you can configure:
Client side
Can update the state of a record
Work offline
Server side
Run a custom script on the instance
URL
Navigate the user to a URL.
Can auto login to the 4Industry instance
Generic info to be filled in
Name: Technical name of the action
Label: Label that will be shown in the mobile application
Type: Client, Server or URL, see above
Configuration: Table for which the action will be a plickable. Only tables extending x_ap4_scm_core_task are supported
Action condition: Condition when the Form Action should be visible
Action configuration:
Style: Color style of the button
Form position: Location where the action should be shown. Is either in the kebab menu in the top right corner or at the bottom of the form
Save form: when checked, will save the form after performing the action. Mainly used for client side actions when changing the sate
Show confirm modal: first show a confirmation modal before triggering the action
Confirm modal text: text that will be shown in the modal
Action payloads
Client action
Client action type: action to be done on the mobile device. In R10.0 only 'Set value' is supported.
Client action config: JSON object with a ‘field', ‘value’ and ‘display_value’ key
Example: {"field":"state","value":"3","display_value":"Closed"}
Action payloads
Server action
Script: script field where any custom code can be run
Action payloads
URL action
Use SN auth: When checked, will send an authentication token with the request, allowing you to directly log in on the same instance as the mobile application is logged in.
Web URL: URL of the page to be loaded. Can be any URL. Note that if you want to load an instance URL, you don’t have to add the instance name. For example: '/x/ap4/mobile/oe/handover'. This is done to make sure that the configuration can be moved as an update set between instances.
Additional information
Please note that the Form actions will be disabled in some situations. See table below for an overview:
Internet connection | Record state | State of Client Form Action | State of Server Form Action | State of URL Form Action |
---|---|---|---|---|
Disconnected | Inactive | ✅ Enabled | ❌ Disabled | ❌ Disabled |
Disconnected | Active | ✅ Enabled | ❌ Disabled | ❌ Disabled |
Connected | Inactive | ❌ Disabled | ✅ Enabled | ✅ Enabled |
Connected | Active | ✅ Enabled | ✅ Enabled | ✅ Enabled |