Home Discussions Questions & Answers Hidden Parameters for Dynamic GL Segment Columns

Hidden Parameters for Dynamic GL Segment Columns

Avatar photoCustomer May 15, 2021 at 3:58 am

Our organization uses multiple ledgers with different Charts of Accounts. I need a single AR report that can dynamically adjust its output columns to include the correct segment columns (e.g., segment1, segment3) based on the ledger selected by the user, without showing the configuration parameter itself. How can I implement this invisible, dynamic behavior?

Viewing 6 reply threads
  • Author
    Replies
    • Support May 15, 2021 at 6:06 pm  

      You should leverage a hidden parameter that utilizes a negative display sequence number to conceal it from the user interface . This hidden parameter should be configured with a `&lexical` anchor and a SQL text that dynamically generates the required column string, based on the value of a user-facing parameter (like the selected Ledger name) . The `Report AR Transactions and Lines` serves as a good example of this, where a hidden Ledger parameter dynamically generates a string for the revenue account columns based on the chart of accounts segment setup .

    • Avatar photoCustomer May 17, 2021 at 2:40 am  

      If the parameter is hidden (negative sequence), how do I define its default value to perform the necessary logic based on the visible Ledger parameter?

    • Support May 19, 2021 at 2:50 am  

      To link the hidden parameter’s logic to a visible parameter, you define its Default Value using the dependent parameter syntax: `:$flex$.parameter_or_lov_name` . For example, the default value SQL could query the Chart of Accounts structure using the visible Ledger parameter name, dynamically building the SQL string for the `&lexical` anchor, ensuring the necessary column list is inserted into the main extraction SQL at runtime , .

    • Avatar photoCustomer May 19, 2021 at 9:17 am  

      Where exactly does this dynamically generated SQL text get placed in the main report query?

    • Support May 20, 2021 at 12:47 am  

      The dynamically generated SQL text is placed exactly where you define the `&lexical` anchor within your main report query . Unlike `n=n` anchors which are confined to `WHERE` clauses, the `&lexical` anchor is versatile and can be used to insert dynamic columns directly into the `SELECT` statement (e.g., `select &columns …`) , . The system replaces the entire placeholder (`&lexical`) completely with the generated SQL text at run-time .

    • Avatar photoCustomer May 21, 2021 at 10:25 am  

      Is there a mechanism to prevent users from accidentally submitting the report without restricting the Ledger, potentially running a massive query?

    • Support May 23, 2021 at 11:17 am  

      Yes, you should set the primary Ledger parameter as Required . The required flag enforces a value entry by the user, which prevents accidental submission of the report with insufficient parameter restrictions . If you need more complex validation than a simple required flag, you can use the ‘Advanced Required Parameters’ feature to define a logical expression (e.g., `:$flex$.ledger_name is not null`) that must be met before submission .

Viewing 6 reply threads
  • You must be logged in to reply to this post.

Login with: