enableNotifications
This function allows you to enable or disable automatic system notification messages that appear during various operations in the brixxbox application. Use this to provide a cleaner user experience by hiding non-essential messages when needed.
Syntax
app.enableNotifications(notifyEvent, state)
Parameters
Parameter | Type | Description |
---|---|---|
notifyEvent | String | The type of notification to control. Currently supported values: "save" |
state | Boolean | true to enable notifications, false to disable them |
Return Value
This function doesn't return a value.
Supported Notification Types
Currently, the following notification types are supported:
"save"
- The "Record saved" message that appears after successfully saving a record"onsave"
- Alias for"save"
, both work identically
Examples
Example 1: Disable save notifications:
// Disable the "Record saved" message after save operations
app.enableNotifications("save", false);
// The following save operation won't show a notification
app.saveCurrentRecord();
Example 2: Re-enable save notifications:
// Enable the "Record saved" message (this is the default)
app.enableNotifications("save", true);
// The following save operation will show a notification
app.saveCurrentRecord();
Notes
- By default, all notifications are enabled
- Settings are specific to the current brixxbox app instance
- This setting persists until the app is reloaded or the setting is changed again
- The notification states are stored in the app's
notificationStates
object