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
        • 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

Dynamic Choice & MultiChoice

Last edited 280 days ago by Jacques TUR.

Dynamic Choice

Dynamic Choice fields return either text or numbers corresponding to the IDs of records. However, it is not possible to directly access the selected records. To retrieve them, you can use the following method:

Accessing the Record:

var selectedRecord := record('my Table', number('Dynamic Choice'));

Dynamic Multi Choice (DMC)

For a Dynamic Multi Choice, you can retrieve an array of records based on the selected elements:

Retrieving Selected Records:

var selectedRecords := for i in numbers('Dynamic Multi Choice') do
record('my Table', i);
end;

Adding or Removing a Selection in a DMC

To programmatically add or remove a selection in a DMC, use numbers() to manage the selected values. For example:

Adding a Record to the Selection:

var currentSelection := numbers('Dynamic Multi Choice');
currentSelection := array(currentSelection, [newRecordID]);
'Dynamic Multi Choice' := currentSelection;

Removing a Record from the Selection:

var currentSelection := numbers('Dynamic Multi Choice');
'Dynamic Multi Choice' := currentSelection[!= recordIDToRemove];
These methods allow precise control over the records selected in a Dynamic Multi Choice field.

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.