Active Query Builder support area

ExpressionField problem

Avatar
  • updated
  • Completed
Hello,

I have a problem regarding the ExpressionField property of a QueryColumnListItem within the ValidateContextMenu event. I am using version 2.9.5.703 of ActiveQueryBuilder and I am trying to customize the context menu. I need the FieldType (via QueryColumnListItem.ExpressionField.FieldType) of the selected QueryColumnListItem in order to add custom functionality. But sometimes the ExpressionField is null and I do not get the field type. As far as i can see it, this happens when a database column is displayed in the QueryColumnListControl but should not be selected in the query (item is not checked) and/or if you use SQL functions (i.e. concatenation). Previously we used version 2.1.0.533 and ExpressionField always had a value, so we always had a field type. Is this a bug or did you change the behaviour of a QueryColumnListItem and I need to find another way to get the field type?

Kind regards
Christian Sack
Avatar
pdv-software
I tried the current version 2.9.6.716 and it works now. Thank you for the help!
Avatar
Andrey Zavyalov, PM
Hi,

Please download and try the new version. This problem is hopefully fixed now.
Avatar
Andrey Zavyalov, PM
ok, we will check this.
Avatar
pdv-software
Hello Ssmagin,

there is one important information I unfortunately forgot to mention. I am saving the SQL and LayoutSQL from ActiveQueryBuilder into files for later use. The described problem only appears when I am loading the SQL and LayoutSQL from the file and assigning them to the ActiveQueryBuilder and then trying to get the FieldType (ExpressionField) from the item. If I then remove the item from the table(via context menu) and adding it again via the DesignPane everything works fine and the ExpressionField is not null, no matter if it is selected four output or not. Is it possible that you changed something in the loading behaviour of ActiveQueryBuilder?

Kind regards
Christian Sack
Avatar
Andrey Zavyalov, PM
We can not reproduce the described problem. If a Query column list item's expression represents single database field, it's ExpressionField property is not null, no matter if it's selected for output or not.
Avatar
Andrey Zavyalov, PM
Hello, Christian.

ExpressionField should not be null if item is not selected for output, we will check this problem and let you know about results. But it's true that the ExpressionField is null when item is SQL expression, this is by design. Active Query Builder is not capable to calculate the result data type of SQL expressions.