Creating Default dimension for the given combination
int dimCount;
DimensionAttribute dimensionAttribute;
str dimValue;
DimensionAttributeValue dimensionAttributeValue;
for (dimCount = 1; dimCount <= conLen(conAttr); dimCount++)
{
dimensionAttribute = dimensionAttribute::findByName(conPeek(conAttr,dimCount));
if (dimensionAttribute.RecId == 0)
{
continue;
}
dimValue = conPeek(conValue,dimCount);
if (dimValue != "")
{
// _createIfNotFound 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);
}
}
defaultDimension = valueSetStorage.save();
custInvoiceLine.DefaultDimension = defaultDimension;
int dimCount;
DimensionAttribute dimensionAttribute;
str dimValue;
DimensionAttributeValue dimensionAttributeValue;
for (dimCount = 1; dimCount <= conLen(conAttr); dimCount++)
{
dimensionAttribute = dimensionAttribute::findByName(conPeek(conAttr,dimCount));
if (dimensionAttribute.RecId == 0)
{
continue;
}
dimValue = conPeek(conValue,dimCount);
if (dimValue != "")
{
// _createIfNotFound 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);
}
}
defaultDimension = valueSetStorage.save();
custInvoiceLine.DefaultDimension = defaultDimension;
No comments:
Post a Comment