Ledger dimensions: Set named dimension value

Code
DimensionAttributeValue         dimAttrValue;
DimensionAttribute              dimAttr;
DimensionAttributeValueSetStorage davss;
RecId                defaultDimension;

davss DimensionAttributeValueSetStorage::find(this.DefaultDimension);

dimAttr DimensionAttribute::findByName(‘MyDimensionName’);
dimAttrValue DimensionAttributeValue::findByDimensionAttributeAndValue(dimAttr“DimensionValue”falsetrue);

if(
dimAttrValue)
{
    
davss.addItem(dimAttrValue);
    
this.DefaultDimension davss.save();
}
AX versionMicrosoft Dynamics AX 2012
PropertiesCreated by Alex 2015-03-26 11:11:58 (Public)