2024 April Release

Class COOQBOL@1.1:AttributeQueryListDef Permanent link for this heading

This class can be used to implement query-based object lists.
Lists of this type can be initialized via a constructor action attractctor or an initialization expression attrinitexpr.

The user is able to adapt the query and to restore the default query.
If the user adapts the query, each refresh will search with the customized settings by the user.
It is possible for the user to reset the query. When the query is reset, a possible constructor action is executed, otherwise a possible initialization expression is executed, otherwise the list is emptied.
Such lists are not refreshed automatically.
A maximum number of 10000 objects can be searched in such lists.
To support user specific search results the default get action COOBOL@1.1:AttrQueryListDefGet and default set action AttrQueryListDefSet has to be used.

Note: Error handling has to be done in the constructor action and initialization expression otherwise the object will not be created if the initialization fails.
The most common error case of queries is that to much results with no access rights for the current user exists.
In this case the query would fail with the error QLPERR_INEFFICIENTQUERY.

Example:
AttributeQueryListDef<MyClass>[] myquerylist nocopy {
  allow {
    MyClass
  }
  attrtreenoautoopen = true;
  get = AttrQueryListDefGet;
  set = AttrQueryListDefSet;
  getver = AttrGetVersionFromActVersion;
  restver = AttrRestVersionFromActVersion;
  init = expression {
    MyClass[] @result = null;
    try {
      searchresult @sr = FROM MyClass c WHERE c.objcreatedby = coouser;
      @result = @sr.GetObjects(10000);
    }
    catch (@ex) {
      //
      // Skip errors on object creation because the object would not be created if the initialization expression fails.
      //
      if (!cootx.IsCreated(cooobj)) { throw @ex; }
    }
   @result;
  }
}

Class Hierarchy

Object > ComponentObject > AttributeDefinition > AttributeObjectDef > AttributeQBOLDef > AttributeQueryListDef