Question on using a!query with grids

i have a grid that get all columns using a!query except one column is calculated by a rule using apply(rule , data)
when the user try to sort using the column that has calculated data the sorting fails and the error message display that the column doesn't exist
Any ideas whats causing this ?

OriginalPostID-203354

OriginalPostID-203354

  Discussion posts and replies are publicly visible

Parents
  • I second the solution given by Benjamin.
    Hi hussams214,

    You can always create a dictionary of final data you want to display.

    And you can also try the following approach:

    1. Create a Dummy CDT for the display purpose which will not have any entity associated with it. Basic structure columns can be textColumn1, textColumn2, textColumn3 and so on.
    2. Create a rule to construct the cdt data with given inputs. Sample code of the rule can be like:

    load(
    apply(
    type!displayCDT(
    textColumn1: _,
    textColumn2: _,
    textColumn3: _
    ),
    merge(
    {
    ri!textColumn1
    },
    {
    ri!textColumn2
    },
    {
    ri!textColumn3
    }
    )
    )
    )

    3. And you can construct the display data where textColumn1, textColumn2 can be actual queried column from DB and textColumn3 values can be the calculated data.

    4. Once the data is in hand you can construct the data subset and display on grid.
Reply
  • I second the solution given by Benjamin.
    Hi hussams214,

    You can always create a dictionary of final data you want to display.

    And you can also try the following approach:

    1. Create a Dummy CDT for the display purpose which will not have any entity associated with it. Basic structure columns can be textColumn1, textColumn2, textColumn3 and so on.
    2. Create a rule to construct the cdt data with given inputs. Sample code of the rule can be like:

    load(
    apply(
    type!displayCDT(
    textColumn1: _,
    textColumn2: _,
    textColumn3: _
    ),
    merge(
    {
    ri!textColumn1
    },
    {
    ri!textColumn2
    },
    {
    ri!textColumn3
    }
    )
    )
    )

    3. And you can construct the display data where textColumn1, textColumn2 can be actual queried column from DB and textColumn3 values can be the calculated data.

    4. Once the data is in hand you can construct the data subset and display on grid.
Children
No Data