Run the below job with your specific set of dimension values and get the default dimension Recid for that combination.
Also, I think I finally found a plug-in that lets me type in my code snippets here in a colorful way. Let's see how it works.
Also, I think I finally found a plug-in that lets me type in my code snippets here in a colorful way. Let's see how it works.
static void createDimension(Args _args) { DimensionAttributeValueSetStorage valueSetStorage = new DimensionAttributeValueSetStorage(); DimensionDefault result; int i; DimensionAttribute dimensionAttribute; DimensionAttributeValue dimensionAttributeValue; container conAttr = [“Department”,”CostCentre” ,”ExpensePurpose”]; container conValue = [“00000030”, “OU_4574”, “Conference/Seminar”]; str dimValue; for (i = 1; i <= conLen(conAttr); i++) { dimensionAttribute = dimensionAttribute::findByName(conPeek(conAttr,i)); if (dimensionAttribute.RecId == 0) { continue; } dimValue = conPeek(conValue,i); if (dimValue != "") { // The last parameter is "true". A dimensionAttributeValue record will be created if not found. dimensionAttributeValue = dimensionAttributeValue::findByDimensionAttributeAndValue(dimensionAttribute,dimValue,false,true); // Add the dimensionAttibuteValue to the default dimension valueSetStorage.addItem(dimensionAttributeValue); } } result = valueSetStorage.save(); }