App Logic
App Logic functions are useful for applying custom functionality to an application as a whole, as opposed to Data Objects, Reports, or other components specifically. App logic is often used to add some additional component to the global interface of an application, such as a Navbar module/widget. App logic can be used to define any custom logic that should be applied to the entire application.
App Logic functions are called once an application is successfully loaded.
Below are the requirements for all custom App Logic functions.
App Logic Function Requirements
| Definition Location: All App Logic functions must be defined in the Logic.App object. |
|---|
| Function Identifier: Each App Logic function identifier must be unique among all property identifiers in the Logic.App object. |
| Parameters: There are no required parameters for App Logic functions, and the Platform will not pass any arguments to any App Logic function. Therefore, you can choose which parameters are defined – if any – and in which order, for your App Logic functions. |
| Return: There is no required return value for App Logic functions. You may return a value from your App Logic functions to be handled by other functions, but the Platform will not do anything with values returned from an App Logic function and will simply discard the returned data. |
Example App Logic Function Definition
Logic.App['onLoad'] = () => {
// Call other custom functions for assessing if user is a first-time user and for creating a modal window
let firstTime = isFirstTimeUser();
if(firstTime) generateWelcomeModal();
};