Question
Hello! Could you please tell me if it's possible in a select-type field, when choosing a certain value, to open a modal window for selecting a value, and after saving this value, the value from the select changes.
For example, I have a certain record where the select field is responsible for the status: "New", "Completed", "Pending Payment". If I change the status from "New" -> "Pending Payment", the current record's value doesn't change immediately, but a modal window appears where I select a certain order and save it, and only after that does the current field's value change.
Accordingly, if I close the modal, the value does not change.
Answer
Actions in Totum are triggered when a value changes. For example, if you change "Application" -> "Pending Payment", the trigger is activated. You cannot pause the action chain until a user performs an action somewhere in the window, etc.
To perform actions with intermediate settings, additional buttons are used to initiate an action that opens a window from which the status is then changed by action. The button can be added to the context menu by right-clicking on the status field.
If you have a combined select, meaning some statuses are set manually and others through intermediate actions, you need to create a list of statuses available for direct setting in the Select code and add the display of the current field value to it.
Example of select code in the Select field with statuses:
=: selectRowListForSelect(table: 'statuses'; field: 'status_name'; where: 'id' = $add)
add: listAdd(list: $direct_statuses; item: $#nfv)
direct_statuses: select(table: 'statuses'; field: 'status_name'; where: 'can_change_directly' = true)
Other statuses should be set through an intermediate temporary table, which is opened by a button in the context menu.
Example of formatting code in the status field:
```totum p1=: panelButton(code: $code; text: "Set special status"; refresh: true)
```code:totum =: linkToDataTable(table: 'tmp_table'; title: "Title for tmp window"; params: $row; refresh: true)
row: rowCreate(field: 'h_row_id' = #id) ```