Filtering on a child collection using the RequestInfo class
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
To filter requested objects using the RequestInfo class,
you instantiate the RequestInfo class using filter
parameters and access the instance as the IRequestInfo interface
type. Constructors for the RequestInfo class allow
you to specify filters on child collections of requested objects
for all Get*( ) methods that return an
object that has child collections. The top instance represents the
requested object and the child instances are added using an Add( ) method
for the collection that is to be filtered.
You must specify a unique key name and value for an IRequestInfo instance
that you use with Get*( ) methods that
return a single IDataAdminElement. To specify criteria
for a collection, you specify the collection name using the single
parameter constructor and assign the query to the QueryString property.
The following code example shows the retrieval of a single tenant with a filter on disabled domains:
|
The following code example shows how to use of the IRequestInfo object
to retrieve a collection of non-allocated tenants with disabled
domains (similar to the previous example). In this case, all the
retrieved tenants will only have domains that satisfy the filter criteria.
Note that you need an IRequestInfo object for the
top level even if you don't want to filter the top collection, as
with the tenants this case. IRequestInfo children
are only added for the child collections that need a filter:
|
The IRequestInfo interface defines several public properties
and methods that you can use to manage entity and collection sorting and
filtering.