Custom buttons¶
A custom button (custom-button evidence, “uživatelské tlačítko” in the
UI) registers a button shown in an evidence’s list or detail view. Clicking
it opens a URL — built from a template with the current record’s data
substituted in — either in an external browser or an internal panel.
Source: podpora.flexibee.eu,
cross-checked against the Flexplorer reference implementation
(getbuttonxml.php / Flexplorer\xml\FelexiBeeButtonXML), which
generates and installs a full set of these buttons via the REST API.
Fields¶
id— identifies the button for create/update/delete, same rules as any other evidence identifier (code:,ext:or a numeric ABRA Flexi id); acode:identifier is required on create.url— the target URL, in absolute form (scheme + domain). Wrap it in<![CDATA[ ]]>to avoid XML-escaping issues with&in query strings. Thefile://scheme is rejected on import.title— button label.description— tooltip text.evidence— which evidence’s records show the button (e.g.adresar,faktura-vydana; for a line-item evidence use e.g.faktura-vydana-polozka).location—list(record overview) ordetail(single record card). Create two separatecustom-buttonrecords to show the button in both places.browser(optional) —desktop(open in an external browser) orautomatic(internal panel, falling back to external; this is the default). Ignored by the web interface.
Every field except browser is required.
Create¶
XML |
JSON |
|---|---|
<winstrom version="1.0">
<custom-button>
<id>code:JUSTICECZ</id>
<url><![CDATA[https://or.justice.cz/ias/ui/rejstrik-$firma?ico=${object.ic}]]></url>
<title>Obch. rejstřík</title>
<description>Display company record in commercial registry</description>
<evidence>adresar</evidence>
<location>detail</location>
<browser>desktop</browser>
</custom-button>
</winstrom>
|
{"winstrom": {"@version": "1.0", "custom-button": [{
"id": "code:JUSTICECZ",
"url": "https://or.justice.cz/ias/ui/rejstrik-$firma?ico=${object.ic}",
"title": "Obch. rejstřík",
"description": "Display company record in commercial registry",
"evidence": "adresar",
"location": "detail",
"browser": "desktop"
}]}}
|
Update: submit only the id plus the fields to change, same as any other
evidence (see Writing data). Delete: action="delete" on the
custom-button element plus its id (see Actions and locking):
XML |
JSON |
|---|---|
<custom-button action="delete"><id>code:JUSTICECZ</id></custom-button>
|
{"winstrom": {"custom-button": [
{"@action": "delete", "id": "code:JUSTICECZ"}
]}}
|
URL template variables¶
The url field is a template evaluated per record; available variables:
Variable |
Meaning |
|---|---|
|
Attributes of the current record (only when a single record is
targeted — mutually exclusive with |
|
Comma-separated list of selected record IDs (list view, multiple selection). |
|
Data of the currently logged-in user. |
|
Full REST API URL of the record. |
|
Base REST API URL of the current company. |
|
Name of the evidence the button is shown on. |
|
Authentication token, usable to call the API from the opened page. |
|
License customer number. |
|
License identifier. |
|
URL of the web interface. |
|
Language of the desktop application. |
For example ${object.ic} inserts the ic (company ID number) field
of the current record, and
query.php?evidence=${evidence}&id=${objectIds} (as used by Flexplorer’s
own installer) builds a link back to every selected record at once.