Use Cases
The user button is used to customize ABRA Flexi by giving developers and users the ability to define a custom action in the form of a button. When the button is activated, a panel is displayed within ABRA Flexi or a web browser is opened — in both cases showing any web page of your choice.
Using the user button, you can display a relevant section of an intranet information system, search for products in a price comparison tool, open the appropriate section of the ABRA Flexi web interface, or trigger an action via our REST API. Parameters such as the VAT registration number of the company currently being edited or the EAN of the displayed product can be dynamically inserted into the web page URL.
How to Use
The user button parameters — such as its label, target URL, and placement within ABRA Flexi — are written into the button definition, a file in XML format. The created user button definition is loaded into ABRA Flexi by importing from an XML file, and upon reconnecting to the company, the button will become part of the user interface (whether in the client application or the web interface).
User Button Definition
Some elements are required (the optional element is browser); each element may appear at most once within a single button definition (with the exception of the id element). A file may contain definitions for multiple user buttons. If a button definition appears multiple times, each occurrence is treated as an update, and only the last update of its properties takes effect. An invalid user button definition will be rejected at the time of import into ABRA Flexi.
id
Record identifiers are used to assign a code/abbreviation when creating a button, and to precisely identify the user button when updating or deleting it later.
The following can be used to identify a user button:
Code/abbreviation – a user-defined label (prefix
code:)External identifier – an identifier from an external application (prefix
ext:)ABRA Flexi identifier – a numeric, immutable identifier assigned by the application (no prefix)
This is a required element; when creating a user button, the element must be provided with a code (abbreviation).
For more detailed information about using this element, see the Record Identifiers section.
url
Specifies the URL of the web page or network resource that will be opened when the button is pressed.
The URL must be provided in its full, absolute form — i.e., it must include the scheme and the server domain address (e.g., https://www.flexibee.eu/).
We recommend entering the URL in
<![CDATA[ ]]>to prevent the presence of the '&' character from causing invalid XML.The
fileURI scheme used for accessing locally stored files is not supported in URL values. User button definitions containing URLs withfile://will be rejected as unauthorized during import.When constructing the URL, you can include variables that will be evaluated by FreeMarker at runtime to pass values from the application. For example,
${object.ic}is used to retrieve the VAT number of a partner in the address book. The stringobjectis required in variable names and is used to reference the current record of the displayed register. The list of available attributes for individual registers can be viewed in the web interface (URLs such as https://localhost:5434/c/mojefirma/adresar/properties).Supported variables:
object– the current record (see the previous point).objectIds– a list ofIDselected records separated by commas.user– the currently logged-in user (see https://localhost:5434/c/mojefirma/uzivatel/properties).url– the full URL of the object on which the button was invoked (e.g., https://instance.flexibee.eu/c/demo/adresar/1).companyUrl– the API address of the company in which the button is placed (e.g., https://instance.flexibee.eu/c/demo/).evidence– the name of the register on which the button is placed.authSessionId– the authentication token for the current user session. It can be used to authenticate requests for the duration of the session. See the use of the authentication token in the Authentication documentation.customerNo– the customer number corresponding to the license.licenseId– the license identifier.flexiUrl- the URL of the web interface.language- the language of the desktop application.
Note: Variables
objectandobjectIdsare mutually exclusive!
evidence
Specifies the register, or optionally a specific relation of an ABRA Flexi register, for which the button should be displayed.
For example,
adresarfor the business partners register,faktura-vydanafor the issued invoices register, and so on. For relation-specific variants, for examplefaktura-vydana-polozkafor issued invoice line items ormajetek-zapujckafor loans in the asset register, etc.For registers in general, use the string shown in the URL of the web interface in the register section (https://localhost:5434/c/mojefirma/cenik).
A list of all registers is available at https://localhost:5434/c/mojefirma/evidence-list
For register relations in general, use the register string (see above) appended with a hyphen and the relation string obtained from the register's relations overview (https://localhost:5434/c/mojefirma/cenik/relations).
location
Specifies whether the button is displayed in the record list view or on the detail card of a specific record.
Permitted values:
list– for the record list viewdetail– for a specific record detail
If the button should be available both in the toolbar on the record list view and on the detail card of a specific record, two user button definitions must be prepared, differing only in the value of the location element.
title
The text displayed on the button.
description
A detailed description of the button displayed in a tooltip.
browser
Specifies the browser in which the URL will be opened. The internal browser loads faster but may not include user customizations and data (passwords, cookies, form data, visited links). The external browser is the environment the user is familiar with.
This is an optional element; the default value is
automatic.By the nature of the web interface, the browser element setting is ignored within it.
Permitted values:
desktop– external browserautomatic– internal browser; if not available, the external browser will be opened
Creation Example
<?xml version="1.0"?><winstrom version="1.0"> <custom-button> <id>code:JUSTICECZ</id> <url><![CDATA[https://or.justice.cz/ias/ui/rejstrik-$firma?ico=${object.ic}&jenPlatne=VSECHNY]]></url> <title>Obch. rejstřík</title> <description>Zobraz záznam firmy v obchodním rejstříku justice.cz</description> <evidence>adresar</evidence> <location>detail</location> <browser>desktop</browser> </custom-button></winstrom>Button Update Example
If you include a unique identification of an existing button in the definition, you can update it. ABRA Flexi supports partial record updates, so when changing the business register URL in the example above, it is sufficient to identify the user button and provide the new URL value:
<?xml version="1.0"?><winstrom version="1.0"> <custom-button> <id>code:JUSTICECZ</id> <url><![CDATA[https://or.justice.cz/ias/ui/rejstrik-$firma?ico=${object.ic}&jenPlatne=VSECHNY&polozek=500]]></url> </custom-button></winstrom>Button Deletion Example
To delete an existing button, you need to use the action attribute (more information about its usage can be found in the Performing Actions section). The user button from the example above can be deleted using:
<?xml version="1.0"?><winstrom version="1.0"> <custom-button action="delete"> <id>code:JUSTICECZ</id> </custom-button></winstrom>
