Privacy Policy and Cookies

By continuing to use our site, you agree to our Privacy Policy and our use of cookies to understand how you use our site, and to improve your experience. Learn More.
I Agree.

SmartClient 14.0: Advanced Querying for Related Entities

Last modified date

SmartClient 14.0: Advanced Querying for Related Entities

SmartClient 14.0 introduces powerful new capabilities for managing data, making advanced querying more accessible and flexible than ever. These enhancements dramatically expand the potential of SmartClient grids and forms, turning them into dynamic, full-featured reporting tools.

Whether you’re building complex reports or working with interconnected data, these new features enable faster and more efficient data handling, both for developers and end-users.

In this post, we’ll explore the following features:

  • Criteria on Related Entities
  • Aggregation and Subqueries in Criteria
  • KeepParentsOnFilter for Load-on-Demand Trees

In real-world applications, querying data from a single entity is often insufficient. You need to filter records based on related entities. For example, when viewing orders, you may want to filter based on the properties of the related customer or sales representative.

SmartClient has long supported this use case, but with 14.0, it’s now completely declarative. You can define criteria directly on related entities using simple AdvancedCriteria syntax:

{
        fieldName: "Employee.email",
        operator: "equals",
        value: "mpatterson@classicmodelcars.com"
}

This example, applied to the Order DataSource, would return only those orders created by a specific sales rep. SmartClient automatically resolves the relationship between Order and Employee, applies the necessary SQL join (or the equivalent operation for non-SQL backends), and filters the results.

There’s also built-in UI support: the FilterBuilder component now includes a “Related field…” option when selecting filter fields.

Screenshot of FilterBuilder field drop-down with Related Fields... option, and screenshot of what the dialog looks like when opened

This enhancement means your end users immediately gain access to this power via the AdvancedFilter window in any ListGrid.

Better still, related-field filtering works with Saved Searches. Power users can define advanced filters on related fields, save them, and share them with others.

Criteria on related entities

If you’re using SmartClient AI Assist, it already understands how to use these features, no additional configuration needed.

See the Filter Related Fields sample to learn more.

Aggregation and Subqueries in Criteria

Filtering on related entities is powerful, but we’ve gone even further. SmartClient 14.0 introduces aggregation and subqueries directly into the criteria system.

Say you want to find all “In Process” orders where the customer has spent at least $20,000. This can now be done declaratively:

    {
        "operator":"and",
        "criteria":[
            {
                "fieldName":"status",
                "operator":"equals",
                "value":"In Process"
            },
            {
                "operator":"greaterOrEqual",
                "value":"20000",
                "fieldQuery":{
                    "groupBy":[
                        "customerNumber"
                    ],
                    "summaryFunctions":{
                        "amount":"sum"
                    },
                    "dataSource":"Payment"
                }
            }
        ]   
    }

SmartClient allows both the field and value in a Criterion to be dynamic, based on queries or summaries over related DataSources. These can include sum, max, or any aggregation logic you need.

There’s also full UI support. The FilterBuilder now includes tools for defining subqueries, giving semi-technical users (like Product Managers) the ability to build complex filters without writing a single line of code.

Aggregation and subqueries in Criteria

This functionality:

  • Works seamlessly with Saved Searches
  • Is supported by SmartClient AI Assist
  • Is enabled by default in all ListGrid AdvancedFilter windows

These features collectively turn any grid into a full-fledged reporting engine, with complex querying available through simple declarative expressions. And in Reify, SmartClient’s low-code platform, non-developers can define these sophisticated queries just by pointing and clicking.

See the Aggregated Filter sample for more details.

KeepParentsOnFilter for Load-on-Demand Trees

A common request with tree views:
“When I filter, keep the parent nodes of any matching items visible, even if the parent itself doesn’t match.”

While easy to support in small, preloaded trees, this becomes a massive challenge in load-on-demand trees. Until now, no other UI framework has solved this cleanly.

SmartClient 14.0 introduces KeepParentsOnFilter, which preserves parent nodes in filtered views, even with dynamic loading. The feature intelligently loads “skeleton branches” as needed, keeping performance high without preloading the entire tree.

It just works with any server-based DataSource. And if you’re using our SQLDataSource, efficiency reaches another level.

Enable the feature in your TreeGrid config and you’re done. SmartClient handles the filtering logic, data loading, and UI rendering.

KeepParentsOnFilter for Load-on-Demand Trees

Check the showcase for more details on how this works.

Conclusion

SmartClient 14.0 turns grids and forms into true data engines. With the ability to filter on related entities, use subqueries, and apply aggregations, your users gain unprecedented power over exploring and analyzing data.

These features allow your applications to:

  • Execute multi-entity queries without custom server logic
  • Build aggregated views and reports directly in the UI
  • Present dynamic calculated fields in real time

Combined with AI Assist and Reify, these capabilities are usable by everyone, from power users to non-technical staff, without writing or maintaining custom code.

SmartClient 14.0 continues to push enterprise-grade productivity to new heights.

Free upgrades are available for licenses purchased within the last 3 months. If you’re outside that window, discounted upgrade pricing may apply.

See the Upgrade Discounts section in our Licensing FAQs for details, or contact our sales team to check your eligibility or request a custom quote.