KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: A Quick Way to Debug a Current Selection
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: July 8, 2024

4D's classic interaction with Tables and Fields uses a selection system per table. Each table in a process maintains a current selection of records. When debugging a process, the table can be added to the expression pane to view the number of records in the table and the current record. However it can be difficult to view the values of the other records in the current selection as the other records have to be set to the current record using something like the Next record command to view them.

With ORDA, a feature was introduced to convert a classic selection to an ORDA entity selection. This feature can be used in the expression pane to quickly view all of the records in the current selection in Object format. To do so, the Create entity selection command can be called on the table of interest.

Take the following example. [Table_1] has a selection of 4 records and only the values from the first record is displayed:

The remaining records can easily be viewed by entering the following expression into the expression pane:

Create entity selection([Table_1])

This will generate an entity selection from the current selection for the passed [Table_1]:

As shown all four (4) records are shown as entities which can be expanded to view each of their values.

This can be a quick way to debug and investigate code that is using classic selections.