private string255 checkInventDimCombination(ItemId _ItemId, EcoResItemColorName _inventColorId, EcoResItemSizeName _inventSizeId) { EcoResSize _ecoResSize; Query _query; QueryRun _queryRun; QueryBuildDataSource _qbds, _qbds2, _qbds3, _qbds4, _qbds5; QueryBuildRange _qbr, _qbr2,_qbr3; String255 _ret; ; _query = new Query(queryStr(EcoResProductVariantsPerCompany)); _qbds = _query.dataSourceTable(tableNum(InventDimCombination)); _qbr = _qbds.addRange(fieldNum(InventDimCombination, ItemId)); _qbr.value(_itemid); //color _qbds2 = _query.dataSourceTable(tableNum(EcoResProductVariantColor)); _qbds4 = _qbds2.addDataSource(tableNum(EcoResColor)); _qbds4.relations(true); _qbds4.fetchMode(QueryFetchMode::One2One); _qbr2 = _qbds4.addRange(fieldNum(EcoResColor, Name)); _qbr2.value(_inventColorId); //size _qbds3 = _query.dataSourceTable(tableNum(EcoResProductVariantSize)); _qbds3.addSortField(fieldNum(EcoResProductVariantSize, Size), SortOrder::Descending); _qbds5 = _qbds3.addDataSource(tableNum(EcoResSize)); _qbds5.relations(true); _qbds5.fetchMode(QueryFetchMode::One2One); _qbr3 = _qbds5.addRange(fieldNum(EcoResSize, Name)); _qbr3.value(_inventSizeId); _queryRun = new QueryRun(_query); // info(_queryRun.query().dataSourceNo(1).toString()); while (_queryRun.next()) { _ecoResSize = _queryRun.get(tableNum(EcoResSize)); if(!_ret) _ret += _ecoResSize.Name; else _ret += "," + _ecoResSize.Name; } return _ret; }