Показать сообщение отдельно
Старый 02.07.2012, 15:57   #10  
Pustik is offline
Pustik
Участник
 
807 / 372 (14) ++++++
Регистрация: 04.06.2004
Уже как-то здесь раньше говорили, что Dimension сделают по аналогии InventDim, т.е. складской аналитики. Может быть оно с каких-то высот и правильно, может оно и имеет какие-то разумные объяснения. Но как взглянешь на код:
X++:
DimensionStorage dimensionStorage;
DimensionAttribute deparmentDimensionAttribute;
DimensionAttributeValue newDepartmentValue;

// Find the deparment dimension attribute
deparmentDimensionAttribute = DimensionAttribute::findByName("Department");  

// Find the new department value we want to put in the new combination.
newDepartmentValue = DimensionAttributeValue::findByDimensionAttributeAndValue(deparmentDimensionAttribute, "abc");

// Load a DimensionStorage instance with the old combination and update the first segment with new value
dimensionStorage = DimensionStorage::findById(ledgerTable.LedgerDimension);
dimensionStorage.setSegment(1,DimensionStorageSegment::constructFromValue("abc", newDepartmentValue));
ledgerJournalTrans.LedgerDimension = dimensionStorage.save();
,который раньше можно было написать одной строчкой, думаешь ну и @опа
__________________
-Ты в гномиков веришь?
-Нет.
-А они в тебя верят, смотри, не подведи их.