How to work with the ValueTree? I have created the GoodsByWarehouses ValueTree on the Form, columns are the GoodsItem – the reference to Goods catalog and the Warehouse – the reference to Warehouses catalog, and the Quantity of Number type.
Here is my query:
| Code |
|---|
"SELECT
| InventoryBalance.GoodsItem,
| InventoryBalance.Warehouse AS Warehouse,
| SUM(InventoryBalance.QuantityBalance) AS Quantity
|FROM
| AccumulationRegister.Inventory.Balance AS InventoryBalance
|
|GROUP BY
| InventoryBalance.GoodsItem,
| InventoryBalance.Warehouse
|TOTALS BY
| Warehouse"; |
Now I want to fill the form attribute with nodes by Warehouse.
But I can't figure out how to create nodes. Do I have to create a new ValueTree, fill it and convert to the FormData?
| Code |
|---|
Result = Query.Execute();
SelectionWarehouse = Result.Choose(QueryResultIteration.ByGroupsWithHierarchy);
While SelectionWarehouse.Next() Do
TreeData = GoodsByWarehouses.GetItems();
EndDo; |