Functions Returning Actions
Actions are returned by the following predefined functions:Â
- openExternalApp. You can configure this event for any module to pass data to an external application. If configured, then an Open External Application icon appears in the client application (in the top right-hand corner) when viewing record details. This event is called when the user taps the Open External Application icon.
- onActionJSON. You can configure a custom action button to perform a custom action by adding a JavaScript function of type CustomActions (where type is equal to CustomActions) to the module of your choice. Once configured, the custom action button appears for the module in client applications, and the onActionJSON event is called whenever a user selects the custom action button.
- onPreSaveJSON. The Save and Save and New buttons appear for modules in the client application when editing or creating records. When a user selects either of these buttons, the onPreSaveJSON event is called. You can configure the onPreSaveJSON event in any module that has the Save and Save and New buttons, and onPreSaveJSON will be called before the record is saved. You use the onPreSaveJSON event for data validation, and to either allow or prevent record saving.
- onSaveJSON. The Save and Save and New buttons appear for modules in the client application when editing or creating records. When a user selects either of these buttons, the onSaveJSON event is called. You can configure the onSaveJSON event in any module that has the Save and Save and New button, and onSaveJSON will be called after the record is saved.
- conditionQueryJSON. You can add JavaScript expressions to the Field Condition attribute of a field in order to apply filters to the field or to a quick selector. When filters are defined for a field or a quick selector, the conditionQueryJSON event is called.
- onValidateJSON. This event validates a quick selector before performing a save, and is considered to be a soft stop rather than a hard stop. You can still save records if validation of the quick selector, as specified by the onValidateJSON event, fails.