InventTable _InventTable;
RecId _RecId;
DimensionAttributeValueSetStorage dimStorage;
Counter i;
DimensionAttribute _dimAttribute;
DimensionAttributeValue _dimAttributeValue;
while select forUpdate _InventTable where _InventTable.ProdPoolId == '0101'
{
_RecId = _InventTable.RecId;
dimStorage = DimensionAttributeValueSetStorage::find(_RecId);
_dimAttribute = DimensionAttribute::findByName("AF_Department",false);
_dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(_dimAttribute,"501",true,true);
dimStorage.addItem(_dimAttributeValue);
_dimAttribute = DimensionAttribute::findByName("AF_Product_Section",false);
_dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(_dimAttribute,"01",true,true);
dimStorage.addItem(_dimAttributeValue);
_dimAttribute = DimensionAttribute::findByName("AF_Product_Line",false);
_dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(_dimAttribute,"0111",true,true);
dimStorage.addItem(_dimAttributeValue);
_InventTable.DefaultDimension = dimStorage.save();
_InventTable.update();
info('Done ' + _InventTable.ItemId );
}
No comments:
Post a Comment