Additional filter of query definition and tree grid view

Hello. On one the tabs for one of our item types, we use the tree grid view/query definition pattern to retrieve a list of the items parents. We've added a filter for is_current = 1, so that we only one result, and the most recent results. This works in most cases.

However, when looking at an older version of the item, there may not be an is_current parent. And if we simply remove this filter, we may get multiple parent results.

Ultimately what we want is to get the most recent generation of this items related parents. We actually do this else where in code by sorting descending by generation and setting max records to "1", but I don't think this will work in a query definition.

Is there a way to filter data this way with the TGV/Query? If not, what would be the best pattern to use to get what we need?

  • While query definitions don't directly support MAX() or similar functions for limiting results, you can achieve a similar effect using sorting and limiting:suika game
    - Sort the query results by generation in descending order.
    - Set the "Maximum Number of Records" property for the TGV to 1.
    This will display only the most recent parent, even for older item versions.