⟵ hearthere ⟶
  • Training course
  • Creating simple tables and fields
  • Codes base level
  • Selects and links between tables
  • Table settings basic level
  • Prefilters base level
  • Conditional formatting basic level
  • Action codes base level
  • Using pop-up windows
  • How to open another table by clicking a button?
  • Hide the header or footer, update the source table when closing the window, close the window forcedly
  • Temporary table creation and features
  • How do I fill in the rows part by passing data to the header?
  • How can I use a temporary table for background calculation and get a result without showing it to the user?
  • How to open a text input window and how can it be modified?
  • Showing the panel with buttons
  • Cycles base level
  • Roles and users on the web
  • Codes advanced level
  • Action codes advanced level
  • Prefilters advanced level
  • Field and table settings advanced level
  • Cycles advanced level
  • Formatting advanced level
  • Select-Tree
  • Executing a scheduled action code
  • Printing and emailing
  • Notifications
  • API interaction
  • Adaptivity and Sections
  • How can I use a temporary table for background calculation and get a result without showing it to the user?

    link_to_table

    Can linkToDataTable be used with the parameter hidden: true in the code even though it is an action function?

    Yes. This is one of the exceptions. Why it is needed: you can call a temporary table, perform calculations in it, and retrieve data from it in a fully technical mode "without showing it to the user."

    To do this, you need to use its parameter hide: true when calling the function. By default, it is false.

    How do I use the value returned by the linkToDataTable function in this case?

    When it is enabled, the temporary table does not open, and the result of the function will be a hash of the temporary table.

    Using this hash, we can retrieve data from it. This is done by using the hash: $hash parameter in functions like select or set:

    =: selectRowList(table: 'tmp_table'; hash: $hash; field: 'data'; field: 'summ'; order: 'id' asc)
        ~hash: linkToDataTable(table: 'tmp_table'; params: $row_hide; hide: true)
            row_hide: rowCreate(field: "order" = #order_number)
    

    Using the resulting hash, can I access any field in the created hidden time table?

    Yes.

    How long is the created temporary table stored in the database?

    1 hour

    Is a temporary table created each time a line of code is called?

    Yes, therefore such calls must be recorded ~ and used with great caution in the row part of the table!