Skip to content
umangenius-logo
U Man Genius docs
  • Pages
    • Welcome
      • ninext-loupe
        Ninext documentation
        • ninox-logo
          Ninext APP
        • Installation
        • Update history
        • Uninstall
        • Popup ninext
          • Fields and Functions
          • Debug tracer
          • 🚧 Errors
          • Finder
        • 🚧 Edit field
        • Copy, paste, duplicate & delete
        • HTML helping functions
        • Native JS
          • Clipboard sample
        • Badges
        • View field event
        • Button event
      • ninox-logo
        Scripting tips & tricks
        • General Information
        • Var and Let
        • Functions
        • If Then else
        • For and while loops
        • icon picker
          select, where, from, to
        • Order By (or Order)
        • create, delete, and duplicate
        • JSON in Ninox
        • Arrays in Ninox
        • Undocumented functions in Ninox
        • Manipulating Record IDs in Ninox
        • Dynamic Choice & MultiChoice

select, where, from, to

Jacques TUR
The select statement returns an array of records (nid). It can be combined with the where, from, and to clauses.
Example:
The following example retrieves the first 10 first names from the Customer table where the first name contains the letter "s":
(select Customer where 'First name' like "s" from 0 to 9).'first name'

Clause where

The content of a where clause is executed on the server.
Therefore, it is not possible to use certain functions, such as alert or dialog, within a where clause.

From and To

Using from and to, only records from index 0 to 9 will be returned.
This feature is useful for retrieving the first x records or for paginating query results.

Execution Block

The execution block is the part after the period at the end of the select statement. In the example above, the execution block is 'first name'.
A more complex execution block can include variables or even additional select statements. Like functions, the last statement in the block determines the type and value of the resulting array.

Example:

The following code produces an array of numbers, representing the total sales for each customer:
(select Customer where 'First name' like "s" from 0 to 9).
(
var a := id;
var i := select invoice where customer = a;
sum(i.TOTAL);
)

high-priority

Warning:

For execution blocks that include access to other tables, there may be bugs if the code is executed on the server.
In such cases, it is better to use a for i in select loop instead.

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.