Here is a code to update the value of particular dimensions for items
InventTable inventTable;
DimensionAttributeValueSetStorage dimStorage;
DimensionAttribute dimAttrOpDiv;
DimensionAttributeValue dimAttributeValue;
while select forUpdate inventTable
{
ttsBegin;
dimStorage = DimensionAttributeValueSetStorage::find(inventTable.DefaultDimension);
dimAttrOpDiv = DimensionAttribute::findByName("DIMENSION NAME);
dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimAttrOpDiv,'VALUE', true, true);
dimStorage.addItem(dimAttributeValue);
inventTable.DefaultDimension = dimStorage.save();
inventTable.doUpdate();
ttsCommit;
}
}
InventTable inventTable;
DimensionAttributeValueSetStorage dimStorage;
DimensionAttribute dimAttrOpDiv;
DimensionAttributeValue dimAttributeValue;
while select forUpdate inventTable
{
ttsBegin;
dimStorage = DimensionAttributeValueSetStorage::find(inventTable.DefaultDimension);
dimAttrOpDiv = DimensionAttribute::findByName("DIMENSION NAME);
dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimAttrOpDiv,'VALUE', true, true);
dimStorage.addItem(dimAttributeValue);
inventTable.DefaultDimension = dimStorage.save();
inventTable.doUpdate();
ttsCommit;
}
}
No comments:
Post a Comment