⟵ 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 to open a text input window and how can it be modified?

    link_to_input

    Which function opens the input window?

    linkToInput — it will open a small window with an input field and two buttons — execute action and close.

    When the execute action button is pressed (its name can be set by the parameter button: "Button Text"), the code passed in code is executed.

    When this code is executed, the value entered in the input field will be available in the variable $#input.

    What are the ways to pass code to it for later execution?

    code can be specified in several ways:

    • as text — code: "=: set(table: $#ntn; field: 'field' = $#input)"

    • name of the field in the same table from which the action code will be taken — code: "field_with_code".


    =:
    linkToInput(html: "Enter order number"; title: "Open order by number"; code: $stradd; button: "Open") stradd: str`'=: linkToTable(table: "sostav_zakaza"; cycle: $number; target: "top")' + $#nl + 'number: select(table: "novye_zakazy"; field: "id"; where: "nomer" = $#input)'` // Note that we concatenate multi-line code using $#nl

    Since the example above is extremely inconvenient, starting from version 2 there is such an option:


    =:
    linkToInput(html: "Enter order number"; title: "Open order by number"; code: $code; button: "Open") ```code:totum =: linkToTable(table: "sostav_zakaza"; cycle: $number; target: "top") number: select(table: "novye_zakazy"; field: "id"; where: "nomer" = $#input) ```

    In this case, everything that appears on the highlighted background will be passed as plain text!

    Is it possible to pass code with a standard link to a line of code?

    No. If you do it like this:


    =:
    linkToInput(html: "Enter order number"; title: "Open order by number"; code: $stradd; button: "Open") stradd: linkToTable(table: "sostav_zakaza"; cycle: $number; target: "top") number: select(table: "novye_zakazy"; field: "id"; where: "nomer" = $#input) // This example is INCORRECT — it will NOT work:

    Then it won't work.

    Is the environment (table, row id, field name) passed when linkToInput is called?

    By default, the code receives some environment parameters:

    • $#ntn — the name of the table from which input is called

    • $#nh — the hash of the current table (we will discuss this in advanced action codes)

    • # — all hashes of the current table.

    Other variables can be passed through the parameter var: "var_name" = "var_value".

    Is there any other way to pass the code?

    Yes. But it is better to use this option in some cases.

    1. You can create a field of type Text with highlight type Totum-code in any table.

    2. Write the code in it, but specifically in the field value, not in the settings.

    3. Retrieve this code through select.


    =:
    linkToInput(html: "Enter order number"; title: "Open order by number"; code: $select; button: "Open") select: select(table: 'table'; field: 'code_field') // if this table stores several codes in rows, then you need to add where

    The same through sugar for select:


    =:
    linkToInput(html: "Enter order number"; title: "Open order by number"; code: @table.code_field; button: "Open") // for fields placed in the header/footer

    =:
    linkToInput(html: "Enter order number"; title: "Open order by number"; code: @table.code_field.name_field[name]; button: "Open") // for fields placed in the row part with search by where: 'name_field' = "name"