Variables
This section documents all predefined variables and constants available in the brixx Client API.
Here you'll find information about variables you can use in your client scripts, including their types, default values, and purposes.
Available Variables
User Variables
- userId - The unique identifier of the current user
- userName - The name of the current user
Record Variables
- recordId - The unique identifier of the current record
- record - The complete record object with all fields and values
- isNewRecord - Flag indicating whether the current record is new
Status Variables
- isLoadingRecord - Flag indicating whether a record is currently being loaded
- isInitializing - Flag indicating whether the application is being initialized
- isReadOnly - Flag indicating whether the current mode is read-only
Context Variables
- appName - The name of the current brixxbox application
- parentApp - Reference to the parent app (if the current app is modal)
Using Variables
These variables can be used directly in your JavaScript code. Examples:
// Check if a record is new
if (isNewRecord) {
// Code for new records
}
// Check the current user
if (userId === 123) {
// User-specific actions
}
// Access record fields
const customerName = record.CustomerName;
Using these predefined variables can simplify and improve your code, as you don't need to write additional code to access this frequently needed information.