if (setDetailOrder) { qbd.orderMode(OrderMode::OrderBy); qbd.fields().clearFieldList(); // убираем sum(InventQty) из select ... qbd.addSortField(fieldNum(SalesPickingListJournalLine,SalesId)); }