⟵ 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 another table by clicking a button?

    link_to_table

    What function can I use to open another table?

    The basic function for opening another table is linkToTable.


    =:
    linkToTable(table: 'table'; title: "Window Title"; target: "iframe")

    Is it possible to open it in a pop-up window and set its size?

    Yes, this is handled by the target parameter:

    • iframe — in an iframe above other windows.

    • blank — in a new window (for proper operation, you need to allow pop-ups in the browser).

    • parent — in the base lower window, all open nested windows will be closed.

    • self — in the current window. If the parameter is not specified, it is processed as self.

    Only one of these options should be specified.

    To set the iframe window size by width, use the parameter width: 800. The number is a fixed width in pixels.

    You can pass not a number, but "80vw", then the number before vw will determine the percentage of the browser window width.

    Is it possible to pass prefilter values to the opening table to see the desired rows?

    If your landing page has a prefilter, you can pass a value to it using the filter parameter:


    =:
    linkToTable(table: 'table'; title: "Window Title"; filter: 'fl_filter' = #number; target: "iframe")

    The value of the passed prefilter will be encrypted with a session key and passed in the URL. Therefore, such a transfer has a volume limitation — you cannot pass large lists or arrays in the filter!

    The prefilter field must be editable for the role. It can be hidden, but it must be editable.

    This way, you can link tables to each other.

    For example, from the Warehouse table, you can open the list of Movements for a specific item.

    How to avoid the error of passing large lists to prefilters?

    To be able to handle large lists in linkToTable, there is an approach:

    1. You create two! prefilter fields.

    2. In the first one, you pass the value by filter. This should be a short value, such as a list of roles or a role number from which the limiting list of categories will be calculated. Or a set of parameters that will allow you to calculate the limiting list in the second field.

    3. The first prefilter field is not linked to the string part. The setting name of the field in the string part remains empty.

    4. In the second prefilter field, you calculate the necessary list of restrictions with code, and this field is linked to the string part.

    What visibility and change settings must the prefilter fields have for this to work?

    The first field must be editable but can be hidden for the role. Only values for editable fields for the role can be passed through the filter of prefilters.

    The second field, which is calculated by code, can be non-editable and hidden.

    How do I open a table and immediately open an insert row with filled parameters?

    The linkToTable has another parameter that reduces the number of user clicks and increases convenience — it's field.

    If you pass a value to field and the target table has an available add row, then when the window opens, the add row will be immediately available, and the specified field will be populated with values.

    For example: we have an order, and we use linkToTable to open the payments table. We can immediately set the calculated remaining payment amount for this order in the payment amount field.


    =:
    linkToTable(table: 'payments'; filter: 'fl_order' = #order_number; field: 'summ' = $calc) calc: #order_summ - $payments payments: listSum(list: $list) list: selectList(table: 'payments'; field: 'summ'; where: 'order' = #order_number)