Question
The idea is as follows:
Data in the form of an array is stored in a cell of the Calculation table in the Cycle.
A temporary table is used as an interface for reading and modifying the array data.
What needs to be written in the button of the temporary table so that the array is recorded in the cell of the row from which the temporary table was called?
Simply using set doesn't work. Maybe the row id needs to be passed?
Answer
To store an array, use the Data type. If they are in your string part, then when calling the temporary table, pass the id
of the row and the cycle number to the technical field in the header (parameter params
in linkToDataTable
).
When using set
back, you need to specify where this set
is going by setting cycle
and where: 'id' = #h_param_id
.
Example of action code opening a temporary table with fields in the Header h_cycle
and h_row_id
:
=: linkToDataTable(table: 'tmp_table'; title: "Some tmp table"; width: 800; height: "80vh"; data: #data; params: $row; refresh: true)
row: rowCreate(field: "h_cycle" = $#nci; field: "h_row_id" = #id)
Example of action code for a button saving values in the temporary table:
=: set(table: 'table_in_cycle'; cycle: #h_cycle; field: 'data' = $rowlist; where: 'id' = #h_row_id; log: true)
rowlist: selectRowList(table: $#ntn; fields: "*ALL*"; order: 'id' asc)