Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
CreateShipment → Creates a DHL Shipping Label.
GetLabel → Shows the shipment Label again.
Add Toolbar Buttons with different functionalities.
As we have already discussed in documentation of SetToolbarButtonMode. These are several buttons that are provided by Brixxbox for each app like adding new record, saving new record etc. These buttons provides general functionality needed by most of the apps but in case your app needs extra functionality, Brixxbox also allows this. It is provided by brixxApi function addToolbarButton. It takes a JSON object as a parameter. This JSON contains all the properties that defines this custom button as well as the functionality provided by it. The properties include name, id, and function to execute on clicking this button etc. Adds a custom button to the app toolbar.
toolbarButtonOptions - It is a JSON Object. In JSON object we passes parameters in the form of key value arguments.It include properties like name, id, function, etc.
As we have already seen a minimal custom print button in above example. Lets now add extra properties like group, css class, and shortcut for our print button. Now we also want this button to be added in our app toolbar on initialization. For this purpose goto current app properties and add onAppInitialized event. Now we need to add following code as a custom code to this event.
Now when our app is initialized, we can see our custom button on the app toolbar and it should look like this.
We can also add different custom buttons to our app depending upon our own requirements.
Calls the OpenAI integration in brixxbox
Adds an Event Listener to the brixxbox or one of its controls
1 Business Brixx UPS Shipping
2 Business Brixx UPS Shipping -> CreateShipment
2.1 Incomming Information
2.2 Returning Information
2.3 Example Usages
3 CancelShipment
4 GetLabel
For accessing the UPS-Shipping brixxbox interface the UPS services need the following setup values (configuration -> settings).
UPSCustomerID Your customer number with UPS
UPSUsername A valid User for accessing the services
UPSPassword The corresponding password
UPSAccessLicenseNumber A license/access key provided by UPS on this page https://www.ups.com/upsdeveloperkit
If no settings are available, a sample label will be generated.
Creates a UPS shipping label
To create labels four groups of information are available:
1. Settings with the following fields (If the group/field is not present default values will be assumed)
ServiceCode: default value "11" UPS Standard. Valid values according to UPS service codes.
MetricMeasurements: "1" sets to true. This is the default. Measurements will be metric e.g. kg, cm or nonmetric for lbs, inch
Language: Language code according to UPS. e.g. deu, eng, spa. this field will be set to user language by default. If the user language is not available for UPS, "eng" will be used.
2. Shipper:
Name
Street
HouseNo
ZipCode
City
CountryCode
StateProvinceCode
AttentionName
Phone
FaxNumber
TaxIdentificationNumber
3. ShipAddress:
Name
Street
HouseNo
ZipCode
City
CountryCode
StateProvinceCode
AttentionName
Phone
FaxNumber
TaxIdentificationNumber
4. ParcelData:
Description
PackageType: Package type according to UPS. If no value is given, the default will be set to: "02" Customer Supplied Package
Weight
Height
Length
Width
In case of success (status 200) the following fields are returned
TrackingNumber: The UPS generated ID. This will be used for further references to this shipment.
LabelData: this is a blob response. It contains the actual label in GIF format and can directly be used for further processing. E.g. “brixxApi.printBlob(LabelData);”
In case of error (status 400) the following fields are returned:
error: a text showing the first error. E.g. “console.log(result.error);”
To cancel an existing shipment only the TrackingNumber is needed.
In case the label is needed again it can be retrieved with an existing TrackingNumber. The result will show LabelData (see CreateShipment results #Returning_Information for details)
Business Brixxes provides special features for business usecases. Each Brixx has an individual set of parameters plus some parameters that are valid for all businessfunctions.
DhlShiping
CreateShipment → Creates a DHL Shipping Label.
GetLabel → Shows the shipment Label again.
DPD Shipping
CreateShipment → Create a DPD Shipping Label.
UPS Shipping
CreateShipment → Create a UPS Shipping Label.
CancelShipment → Removes existing Shipment
GetLabel → Shows the shipment Label again.
InventoryManagement → Does Inventory Movements within an ERP Setup
Move
CurrencyConverter
Convert → Converts a currency to annother currency.
Datev Export
DatevExport → This function exports a Datev CSV file for a given timeframe.
sqlDataRead Example
sqlMainData Example
sqlGetCounter Example
GS1 Code Splitter
Split → Splits a barcode (or 2d code) into its GS1 AIs an Values.
Diamant
DiamantBusinessBrixx
SEPA Export
DPDCreateShipment -> Creates a DPD Shipping Label
Creates a DPD Shipping Label
For accessing the DPD-Shipping brixxbox interface the DPD services need the following setup values (configuration -> settings).
DPDUserCredentialsCloudUserID
DPDUserCredentialsToken
DPDPartnerCredentialsName
DPDPartnerCredentialsToken
If no settings are available, a sample label will be generated.
To create labels three groups of information are available:
1. OrderSettings with the following fields (If the group is not present default values will be assumed)
language: Values „de_DE“ or „en_EN“ are allowed. If nothing is set „de_DE“ will be assumed.
ShipDate: if not available will be set to „today“
LabelSize: „PDF_A4“ or „PDF_A6“. If nothing is set „PDF_A4“ will be assumed.
LabelStartPosition: “UpperLeft“, „UpperRight“, „LowerLeft“, „LowerRigh“
2. ShipAddress:
Company
Gender
Salutation
FirstName
LastName
Name
Street
HouseNo
ZipCode
City
Country
State
Phone
3. ParcelData:
YourInternalID: should be set to your own reference (e.g. order no). if no value is provided a timestamp will be set.
Content
Weight: in kg
Reference1
Reference2
ShipService: set to a valid DPD-Service. If nothing is set “Classic” will be assumed.
Detailed informationen for field usage can be found at https://esolutions.dpd.com/dokumente/DPD_Cloud_Service_Webservice_Dokumentation_DE.pdf
In case of success (status 200) the following fields are returned
ParcelNo: The DPD generated ID. This will be used for further references to this shipment.
YourInternalID: The same ID that was provided for the request
TimeStamp: an informational time stamp when the request was processed
LabelData: this is a blob response. It contains the actual label in PDF format and can directly be used for further processing. E.g. “brixxApi.printBlob(LabelPDF);”
In case of error (status 400) the following fields are returned:
TimeStamp: an informational time stamp when the request was processed
ErrorDataList: an array with detailed information what went wrong. Every error will show the following fields
ErrorID: an internal error no
ErrorCode: an internal error code
ErrorMsgShort: Error information short version
ErrorMsgLong: Error information long version
This module creates a SEPA file in XML format.
This function exports a Datev CSV file for a given timeframe. The fuction needs 3 customized SQL scripts to process the data.
As this function calls customized SQL scripts, it will add SQL parameters from the function call to the SQL calls.
@company
@dateFrom
@dateUntil
Those parameters can be used within the SQL statements.
sqlDataRead script
Auftragsnummer
Artikelnummer
ArtikelRecordId
Paragraph13b
NettoWert
BruttoWert
Debitorenkonto
Kreditorenkonto
Sachkonto
SteuerID
Buchungsschluessel
Buchungstext
Rechnungsdatum
Rechnungsnummer
Leistungsdatum
AttachementId
BuchungszaehlerTabelle (nvarchar that defines the tabel, where the booking counter is stored)
BuchungszaehlerSpalte (nvarchar that devines the column for the booking counter)
IstAutomatikKonto
IstInnerbetrieblich
sqlMainData script
Kundennummer
Konto
Firmenname
Nachname
Vorname
Anrede
Adresstyp
Strasse
Hausnummer
PLZ
Stadt
Zusatzinformation
sqlGetCounter script
This script needs to return the actual booking counter as number.
sqlDataRead Example
sqlMainData Example
sqlGetCounter Example
This is the main script, which is responsible for collection all the data, which needs to be exported.
Splits a GS1 code into its AIs and values
This is usually used in the onScan event where you use the plain scan result as the input. The fnc1Char parameter is optional and only used, if the scanner sends an different (visible) character instead of the default fnc1 (CHAR29).
Mandatory fields: gs1Code
Especially with keyboard wedge scanners, it is often usefull to use a visible character as the FNC1 char.
The result variable in this case:
Example for a getDatevData script
This is the main script, which is responible for collection all the data, which needs to be exported.
@company - If you work with multiple companies, you have to export each company by it's own.
@dateFrom - Start date for the export
@dateUntil - End date for the export
This brixxbox module allows to retrieve data from the Diamant Accounting Software and post data to it
The Method Retrieves the data specified with dataType (like Address, CostCenter and so on). The searchParams and fieldMatch JSON properties are valid for all methods, but the fields mentioned in it are depending on the datatype used. For example: postcode is a valid searchParam for addresses, but not for cost centers.
The Get method will return the data it fetched from Diamant, so you get an array of JSON objects. The fieldMatch prameter will tell the brixxbox to change field names, so that it is more useful in an brixxbox environment.
This will retrieve all addresses from diamant. Field names are the original diamand field names
This will retrieve all addresses with Postcode 61118 from diamant and return the result. Only the fields "key" and "Name1" will be returned.
This code will write an address to Diamant
This method allows you to retrieve the data and insert it into the database. Query parameters work the same and are optional but you must user fieldMatch to assign diamant names to brixxbox field names
This will retrieve all addresses from diamant and insert it into the table address the table will be wiped right before the import.
This will retrieve all addresses from diamant and update the records with the same id as in fieldMatch.
More types can be added at request.
Request Data
Address (Adressen)
CostCenter (Kostenstellen)
GenLedgAccount (Sachkonten)
CostObject (Kostenträger)
PrimCostElement (Primärkostenarten)
Project (Projekte)
Company (Mandanten)
Customer(Konten)
Vendor (Vendor)
Posting (Buchungen)
Transctions
Sends a PDF to a printer, that is connected by the BrixxboxCloudGateway. You can sent a document to a cloudprinter by using createReport as well
A json object
Shows the email compose Dialog, or sends an email without an interface popup.
emailOptions - (optional) Json object with email parameters.
to - array of email addresses
cc - array of email addresses
bcc - array of email addresses
text - message text
subject - subject
from - single string with an email address
replyTo - single email, that will be used as to reply to
autoSend - if set to true, the mail will be send automatically. You will not see a dialog at all. (Default is false)
hideToEmail - if set to true. The recipients email address is hidden in the email dialog
attachmentIds - an array of attachment ids that will be sent as an attachment,
attachmentBlobs - an array of blobs objects that will be sent as an attachment, {name: myFileName, blob: myBlob}
recordId - RecordId if you would like to attach the email to an record. If empty, this is the current record Id (available from 18.11.2021)
appName - AppName if you would like to attach the email to an record. If empty, this is the current App Name (available from 18.11.2021)
Shows the dialog without any predefined values
Shows the dialog text and to addresses
Sends the email without a dialog
This is the script, which is responsible for collection all the address data, which needs to be exported.
Creates a deep copy from a config record. Typical example is to create a copy of an "order" record, with a copy of all the "orderLines" from that source "order". brixxbox will use the "Cascade Copy" flag of a grid control, to decide if which referenced records will be copied.
configName
recordId - the id of the source record
additionalValues - json object of values in the target record that should be modified. e.g. an "orderDate" field. Can be null, in this case you get a 1:1 copy except the record id.
Exact copy:
Copy with new date for header data and manipulating two columns of line item data:
Creates an url, that leads to a standalone app for pulic use. There is still a valid user logged in. The public user has to be configured in the settings as a "valid external user" for security reason
Creates a report on the Server and retrieves it to the client. The only format, currently supported is pdf.
reportControlId - the id of the reportControl in your app. This can be invisible, if you don't need a preview.
createOptions - JSON Object with options
print - (bool, default = false) if set to true, this will trigger the print dialog after the report is create.
archive - (bool, default = false) if set to true, the report is saved as an attachment to the current record,
saveFile - if set. the report will be downloaded with a generic file name (brixxbox-print.pdf), except, if saveFileName is set.#
saveFileName - if set. the report will be downloaded with that file name.
reportId - (optional) if defined, this will overruled the reportId given for the control in the config editor. This is not the controlId, but the id (name) of the report definition
cloudPrinter - (optional) the created report will be send to the cloud printer right after creation.
Like a on a dataRequest, all controls of the current app will bo automatically send as report parameters, plus the recordId of the current record as "id", even if you dont have a control "id" in your app.
This documentation provides a complete overview of the xRechnung
object used in the createPdf
endpoint for generating ZUGFeRD-compliant invoices. The xRechnung
object contains key information required to create a legally compliant electronic invoice, following the specifications of the XRechnung format.
The xRechnung
object is part of the main payload sent to the createPdf
endpoint. Below is the structure and detailed explanation of all properties within the xRechnung
object.
invoiceMain
This object contains the main details of the invoice, including invoice number, dates, buyer, seller, and payment terms.
Type: object
Properties:
invoiceNo
(string
): The unique identifier of the invoice.
invoiceDate
(DateTime
): The date the invoice was issued.
paymentReference
(string
): Reference used for payments.
orderNo
(string
): The related order number.
orderDate
(DateTime
): The date of the related order.
currency
(enum
): The currency of the invoice. See currency enum.
buyer
(object
): Information about the buyer.
seller
(object
): Information about the seller.
notes
(array
): Notes related to the invoice.
paymentTerms
(object
): The terms of payment.
grandTotalAmount
(decimal
): The total amount of the invoice.
duePayableAmount
(decimal
): The amount due for payment.
Other related invoice properties.
additionalReferencedDocuments
This array contains documents that reference the invoice, such as orders or contracts.
Type: array
Properties:
id
(string
): Identifier of the referenced document.
issueDateTime
(DateTime
): Date and time the document was issued.
referenceTypeCode
(enum
): Reference type code. See referenceTypeCode enum.
attachmentBinaryObject
(string
): Base64 encoded binary object of the attachment.
filename
(string
): Filename of the attachment.
typeCode
(enum
): Type code for the document. See typeCode enum.
tradeLineItems
This array contains items or services billed in the invoice.
Type: array
Properties:
globalID
(object
): Global ID of the item or service.
sellerAssignedID
(string
): ID assigned by the seller.
name
(string
): Name of the item or service.
billedQuantity
(decimal
): Quantity billed.
lineTotalAmount
(decimal
): Total amount for the line item.
taxCategoryCode
(enum
): Tax category code. See taxCategoryCode enum.
netUnitPrice
(decimal
): Net unit price of the item.
unitCode
(enum
): Unit code for the item. See unitCode enum.
Other related line item properties.
taxes
This array contains detailed tax information applied to the invoice.
Type: array
Properties:
basisAmount
(decimal
): Amount on which the tax is calculated.
percent
(decimal
): Tax percentage.
typeCode
(enum
): Type of tax. See taxType enum.
categoryCode
(enum
): Tax category code. See taxCategoryCode enum.
exemptionReasonCode
(enum
): Reason for tax exemption. See exemptionReasonCode enum.
serviceCharges
This array contains additional charges applied to the invoice.
Type: array
Properties:
tax
(object
): Tax information related to the service charge (similar to taxes
object).
amount
(decimal
): Amount of the service charge.
description
(string
): Description of the service charge.
receivableSpecifiedTradeAccountingAccounts
This array contains accounting accounts related to the trade, either receivable or payable.
Type: array
Properties:
tradeAccountID
(string
): ID of the trade account.
tradeAccountTypeCode
(enum
): Type of trade account. See tradeAccountTypeCode enum.
currency
Represents currency codes.
schemeID
Identification schemes for IDs.
country
Country codes.
subjectCode
Subject codes for notes.
contentCode
Content codes for notes.
profile
Invoice profiles.
type
Invoice types.
referenceTypeCode
Reference type codes for documents.
taxCategoryCode
Tax category codes.
taxType
Tax types.
electronicAddressSchemeID
Electronic address schemes.
typeCode
Document type codes.
unitCode
Unit codes for line items.
paymentMeansTypeCode
Payment means type codes.
tradeAccountTypeCode
Trade account type codes.
This documentation provides a complete and structured overview of the xRechnung
object, including all properties and enumerations used in the payload.
Executes a stored procedure.
procedureName - The name of the stored procedure
procedure parameters - If you need to add parameters, you can use this json object to set them
queryOptions - (optional) a json object with options for the request
timeout - (optional) timeout for the SQL Request. Default is 30 seconds
connectionKey - (optional) a key to a custom settings entry with the connection string to an external MSSQL database
1. Simple (pay attention to the await keyword)
2. With parameters (pay attention to the await keyword)
3. Short version (pay attention to the await keyword)
4. With Timeout
2. the message you want to send. That depends on the service, you want to post to. here are some examples for Microsoft Teams(), but it can be as easy as seen in exampel 1
0
Euro (EUR
)
1
US Dollar (USD
)
2
British Pound (GBP
)
3
Swiss Franc (CHF
)
4
Japanese Yen (JPY
)
0
Unknown
1
GLN (Global Location Number)
2
DUNS (Data Universal Numbering System)
3
VAT ID
4
National Tax ID
5
Other
0
Germany (DE
)
1
Austria (AT
)
2
Switzerland (CH
)
3
United States (US
)
4
United Kingdom (GB
)
0
General Information
1
Legal Information
2
Payment Information
0
Free Text
1
Legal Notice
2
Payment Instruction
3
Delivery Information
1
Basic Profile
2
Comfort Profile
3
Extended Profile
4
EN 16931 Profile (XRechnung
)
0
Invoice
1
Credit Note
2
Debit Note
3
Correction Invoice
0
Order Reference
1
Despatch Advice Reference
2
Delivery Note Reference
3
Contract Reference
0
Standard Rate
1
Reduced Rate
2
Zero Rate
3
Exempt
4
Reverse Charge
0
Value-Added Tax
1
Sales Tax
2
Service Tax
88
89
EDI (Electronic Data Interchange)
90
Web Address
50
Attachment
51
Image
52
PDF Document
0
Piece (PCE
)
1
Kilogram (KGM
)
2
Liter (LTR
)
3
Hour (HUR
)
4
Day (DAY
)
0
Bank Transfer
1
Direct Debit
2
Credit Card
3
Cash
0
Debtor Account
1
Creditor Account
2
General Ledger Account
3
Cash Account
Deletes a record from the database.
options - json object
id - the record id. Optional. By default, this is the current record id. (The current record id can be accessed here: brixxApi.actualRecordId)
noConfirmMessage - Optional. By default, this is false. If set to true, you will not get a confirm MessageBox. the record will be deleted.
1. Simple
2. Simple - No Confirmation
3. Without displaying the record
Disables (or enables) the hyperlinks in grid cells, automatically generated for combo box controls. This function also refreshes the grid.
Displays a record in an brixxbox app. To get a record, you could use e.g. loadRecord
the record.
the current control. This control is excluded from the discard changes check, that occurs before the record is displayed
Simple (pay attention to the await keyword)
Retrieves the most recent attachment for a given record ID as a blob.
This function queries the database to find the latest attachment associated with a specific record ID. If the documentTypeId
is 0, the document type filter is ignored.
Parameters
tableName
: string
The name of the table where the record is stored.
recordId
: number
The ID of the record for which the attachment is being retrieved.
documentTypeId
: number
The ID of the document type to filter by. If 0 or null, this filter is ignored.
Returns
Promise<Blob>
A promise that resolves to a blob containing the attachment, or null if no attachment is found.
Example
Gets a GUID Token, that identifies the browser. This token will NOT be different, when you close all browser tabs and start the brixxbox again. But it will be different, when you delete the local storage for that url. You could use this to identify a shopping cart, for example.
GUID stands for Global Unique Identifier. A GUID is a 128-bit integer (16 bytes) that you can use for authentication purposes. There are many types of GUID tokens, one of them is browser token. We can use this token to identify a user for same browser because his token will NOT be different, when you close all browser tabs and start the Brixxbox again. But it will be different, when you delete the local storage for that url. This function can be used to get GUID for browser. It can then be used to keep user session open. Another usecase is that it could be used to identify a shopping cart. An important aspect here to note is that when when you close all browser tabs and start the Brixxbox again, this token will not be different.
An example user is that user can get access tokens using this getBrowserToken functions from two apps and compare them to confirm user identity i.e after login this can be used as authenticate the user between different browser sessions.
It provides the functionality of excluding controls from being affected by the readOnlyMode.
In our doc for readOnlyMode, we have seen how we can use it to disable all app controls or some of them. For that we will always have to make a call to readOnlyMode function, if we want anything to change. excludeFromReadonly function provides the functionality of excluding controls from being affected by the readOnlyMode. For example, we can set this function in appStart event then it will effect all readOnlyMode function calls after that. It means if we have set some controls to be excluded for readONly Mode function at app start, they will always be excluded from it influence during app life time and we do not have to make calls to this function again and again. If user wants to update excludeFromReadonly controls list then a new call to excludeFromReadonly will overwrite the previous setting.
Control array - It is a json array of control ids.
As we have seen in ReadOnlyMode the example of address app and how we disabled every control using it without options. Now let say we want "Address Number" and "Name" controls to stay enabled. For this purpose, we will need to add these controls to our excludeFromReadOnly function and put this code in appStart event.
As we can see in snapshot below Address number and name controls are editable after the app is started. We can use this functionality with any number of apps.
As the name suggests, this functions is to get date. This function when used without any arguments returns a date in this format 'yyyy-mm-dd'.
It is very important to be cautious because different date formats can lead into worng results when in comparison.
param - (optional). If empty it will return todays date. User is also allowed to provide a date or moment object of javascript.
Following examples shows all three usages of getDate function. Lets suppose we want to know the new order placement date which is today then we can use 1st or second example. We also suppose that our order delivery date is after one month then we can use the third example and use this date as a delivery date.
GUID stands for Global Unique Identifier. A GUID is a 128-bit integer (16 bytes) that you can use for authentication purposes. We use this token to identify a user for same browser session. This function can be used to get GUID for current user sessions. It can then be used to authenticate user between different apps. Another usecase is that it could be used to identify a shopping cart. An important aspect here to note is that when when you close all browser tabs and start the Brixxbox again, this token will be different.
An example user is that user can get access tokens using this getSessionToken functions from two apps and compare them to confirm user identity i.e after login this can be used as authenticate the user.
Converts a date to the total days since 1.1.1970 to make it easy comparable. You can use Date, or DateTime as input and even if two datetime values do have different times.
This functions is used to trigger global search of the whole workspace. It only takes one parameter which is a search keyword. This function is directly used in the each Brixxbox workspace. User can find it in top right corner of each workspace page. It is a textbox accompanied by search button. User needs to enter a string in the global search field at the top of the screen and it will trigger the search function. It can be useful if you want to search for a scan result or anything within your workspace in seconds.
searchTerm - It is of type string.
User can find this button on top right corner. It looks like this.
User can enter any keyword and it with return thespecific results. User can also use this function in their apps. For this user need to provide a search keyword and can use it to retreive data from the global workspace. If user want to search "address" the code will look like this
Brixxapi allows user to set a claim value. This claim Value gets added when user gets logged in. It is used to identify users claim. For example, to check whether a user is someone who he claims to be or not. By using this function, we can get userClaim and make useful comparisons in our apps.
claimName - This is the only paramter this function takes. It is the claiName which should be in the form of string.. Brixxapi allows user to add claim name with or with out "claim_" prefix.
We can use "getUserClaim" function to get user's claim, a way to check user identity. As a parameter, we need to provide the claimName to this function. We can provide only the claimName or the claimName plus "claim_" as prefix. Lets see both of them in action. We have a claimName "EfitDealerNumber", now we want to get userClaim:
Lets first do it without prefix "claim_".
It is ame as the previous example but now we use prefix.
An important thing to notice here is that it is required by Brixxbox that for using SQL Parameters for claims must have to start with the "claim_" prefix.
For example, Userclaims can also be used as SQL parameters:
All users in any Brixxbox workspace shoyuld have been assigned a specific user role. isUserInRole takes a string argument role. On the basis of this role parameter, it determines whether a logged user
role - It is a string parameter. It is the name of logged in user role which needs to be checked.
We have seen address app in the docs of ReadOnlyMode function. Now we will build upon that functionality. In it we have used readOnlyMode function to disable all ap controls. Now we want tht if user is of admin role then all the controls should be enabled and disabled otherwise. For this we need to update our custom code. It should look like this.
Now If user 'raghib' has an admin role assigned to him then address app will be enabled for him and for all other non admin users. It will be disabled.
This function takes a string as a parameter. This string should be an email address of a new user to whom admin of current workspace wants to invite. This function provides functionality of sending an email to a new user.
In order to learn more about this function click here.
Loads a record, based on the value in the control, given as a parameter in the first argument and displays it. This function just combines loadRecord and displayRecord
Simple (pay attention to the await keyword)
Stores and retrieves local values, like settings or something, that you want to have persistent on this specific browser. The value will be saved only for the browser you are currently working on. The value will be save in the scope of the current workspace you are working in.
key - Key name
value - (optional) value you want to save. If this is empty, brixxbox will return the value, you saved before.
This is not an asynchronous operation. No await needed!
Loads a record of a specific app config from brixxbox server by a specified field and returns a promise. This is a async function. You have to await the result, if you want to use it.
configName - the name of the app
keyField - the search field
value - value to search for
The result is a brixxbox record object. All fieldvalues of that record are stored in data as key value pairs. (e.g. myRecord.data.addressName). The id of the record can be found in myRecord.id.
Loads a record of a specific app config from brixxbox server and returns a promise. This is a async function. You have to await the result, if you want to use it.
configName - the name of the app
id - recordId to load
The result is a brixxbox record object. All fieldvalues of that record are stored in data as key value pairs. (e.g. myRecord.data.addressName). The id of the record can be found in myRecord.id.
Simple (pay attention to the **[await](/globalDoc/glossary_await)** keyword)
Loads a record, based on the current config, from brixxbox server and returns a promise. This is a async function. You have to await the result, if you want to use it. This function will not display the record, it will just load and return it. To display the record, use the function result with .
The first parameter is a control with the key value, that will be used to find the record (like an address number)
Simple (pay attention to the await keyword)
Returns the geo location and additional information like speed and altitude if available. Be aware, that this is an asynchronous function and you have to use await.
The brixxbox offers a client-side event log. Events like save/delete record, data validation messages, internal events etc. will be logged. In addition, the log can be accessed through brixxApi. The log view is located in the side bar. It will be shown in an extra tab page (only if data is available). Per default only entries for the current brixxApi Object (and its children) will be visible.
Parameters can be passed as a json object.
text: the actual log text. If this value is missing no entry will be generated.
context: This should be set to a plausible group-criteria (e.g. “save” for record saved. “validate” for data validation). This value can also be used to remove the complete group from the log (see example).
status: Status can have the following values “info”, “success”, “warning”, “danger” or “error”. The log entry will get its color set accordingly. “danger” and “error” are interchangeable.
info: Additional info can be set. If empty its value will reflect the app title of the brixxApi object.
recordId: If not passed as a parameter the value will be set to record-ID of the brixxApi object (brixxApi.record.id).
To remove an existing context from the log for the current brixxApi object logReset is available:
It can set the whole brixxbox app or some controls depending upon the use case which is required, in a readonly mode. All Input fields, save- new- and delete toolbar buttons are disabled.
In Brixxbox, we have certain types of users like system users those who build the system, users those who will use the system, and admins, they will manage the systems etc. Each user should have different access to the system. It means all acess rights should only be given to admin users. Lets suppose we have an orders app and recorded orders. System users should only be allowed to fetch and check orders while on the other hand admins shouls also be allowed to edit orders and make changes to them. This is this brixxApi readOnlyMode function comes into play.
This code sets the whole app to read only mode. All the input controls and even the toolbar button get disabled.
readOnlyMode function can be used with or without options. Following are the optional parameters:
readOnly - (bool, default = true) This indicates if the readOnly mode is enabled (true) or disabled (false). If it is set to true or without options, it disables the whole app. If set to false, the app starts to behave normally. Every control and each toolbar button is enabled.
options - It is a JSON object which can be passed as an additional options.
exclude - It is an array of controlIds that should be excluded from the disable functionality of readOnlyMode function.
We can use this "readOnlyMode" function with or without options. Lets see both of them in action.
To disable each and every control and toolbar buttons use this function without any options like
In order to enable all the controls, set the readOnlyMode function with false value of readOnly parameter. It will enable back all the controls and the app will start behaving normally.
Now if we dont want to use default functionality of disabling or enabling the whole app, we can usereadOnlyMode options to enable or disable some of the controls. Lets say we want to disable 2 controls from an app then we have to pass the name sof these controls in exclude option array like
Lets say we have address app and we want to disable all of it. It can be done in different ways. For a moment, lets stick to "appInitialized" event. Add this function as a custom code of "appInitialized" event and save the app. It will look like this
As we can see each control as well as app toolbar is also disabled.
Reloads the content of a single control (like combobox or grid) or of all such controls in an brixxbox application.
Loads a record from brixxbox server and returns a promise. This is a async function. You have to await the result, if you want to use it. This function will not display the record, it will just load and return it. To display the record, use the function result with displayRecord.
The first parameter is a record id
Simple (pay attention to the await keyword)
brixxApi function to set a value to a field
controlId => Id of the control
value => The value, you want to set. This could be a number, a date, a string (depending on the control type of course). setFieldValue will do all the conversions for you.
1. Simple textbox
2. With a variable
3. Setting a date
4. Setting a date to a calendar control scrolls to that date.
5. The Calendar supports subcontrols to set. You can add resource(s) to the calendar for example:
Refreshes the content of a single control based on its DataSource (not the SubDataSource!). If outside parameters have changed, you can force the brixxbox to reload the content of that control.
Replaces a text with the current values of the app.
Calls a server function and returns the result
functionName - the configured name of the function in App_ServerSideFunction
functionsParameters - (optional) json object with function parameters. The will be available in the function under body.parameters
options - (optional) See examples. You can use the options to get the payload of the request or a postman example, instead of calling the function. Can be used to debug a function on your local machine
To call a function and get the response object:
To get an example payload based on the current app state:
To get an example postman collection including the payload of the current app:
Sets the value, that is used to compare to the actual control value. If both are not equal, the field will be marked as changed.
1. Simple Example Usages
2. Simple Example Usages with variables