// Creating Financial Dimension Value For default Dimension in AX 2012
DimensionAttributeValueSetStorage valueSetStorage = new DimensionAttributeValueSetStorage();
DimensionDefault result;
container conAttr = ["BusinessUnit","Department", "Project", "Woarker"]; // Dimension Names with Exact
container conValue;
Name dimValue;
DimensionAttributeValue dimensionAttributeValue;
conValue = ["BusinessUnit","Department","Project","Worker"];
for (i = 1; i <= conLen(conAttr); i++)
{
dimensionAttribute = dimensionAttribute::findByName(conPeek(conAttr,i));
if (dimensionAttribute.RecId == 0)
{
continue;
}
dimValue = conPeek(conValue,i);
if (dimValue != "")
{
dimensionAttributeValue =
dimensionAttributeValue::findByDimensionAttributeAndValue(dimensionAttribute,dimValue,false,true);
valueSetStorage.addItem(dimensionAttributeValue);
}
}
result = valueSetStorage.save();
DimensionAttributeValueSetStorage valueSetStorage = new DimensionAttributeValueSetStorage();
DimensionDefault result;
container conAttr = ["BusinessUnit","Department", "Project", "Woarker"]; // Dimension Names with Exact
container conValue;
Name dimValue;
DimensionAttributeValue dimensionAttributeValue;
conValue = ["BusinessUnit","Department","Project","Worker"];
for (i = 1; i <= conLen(conAttr); i++)
{
dimensionAttribute = dimensionAttribute::findByName(conPeek(conAttr,i));
if (dimensionAttribute.RecId == 0)
{
continue;
}
dimValue = conPeek(conValue,i);
if (dimValue != "")
{
dimensionAttributeValue =
dimensionAttributeValue::findByDimensionAttributeAndValue(dimensionAttribute,dimValue,false,true);
valueSetStorage.addItem(dimensionAttributeValue);
}
}
result = valueSetStorage.save();
No comments:
Post a Comment