Skip to main content

The user button opens a window for each of the selected records

Written by Petr Pech

A custom button triggered on several selected records opens a window for each of them separately. This is the correct behavior — it's determined by which variable the button has in its address.


Two Variables

Variable

Behavior

${object}

Refers to one record. If more records are selected, the button is triggered for each one separately — that is, as many times as there are selected records.

${objectIds}

Inserts a list of IDs of all selected records, separated by commas, into the address. The window opens once.

⚠️ The two variables are mutually exclusive — only one of them can be used in a given address. If you don't specify either, the button behaves as if object were used, so a window opens for each selected record.


How to Open a Single Window

In the button definition, use ${objectIds} in the address:

<winstrom version="1.0">
<custom-button>
<id>code:MOJE-AKCE</id>
<url><![CDATA[https://muj.server.cz/akce?ids=${objectIds}]]></url>
<title>Zpracovat vybrané</title>
<evidence>faktura-vydana</evidence>
</custom-button>
</winstrom>

ℹ️ If a large number of records are selected and the address would exceed the allowed length (default 2,000 characters), ABRA Flexi stores the list of IDs in temporary storage and inserts the data-url parameter into the address, referring to this list, instead of ${objectIds}. Your application should therefore be able to handle both cases.


Related

Did this answer your question?