Retrieving Documentum repeating values

Documentum provides the functionality of repeating properties – properties that have more than one value. Retrieving those values is a simple matter of getting the number of values for that property, and then request each one of the values.

Here’s a small utility method:

private static object[] GetRepeatingValue(IDfSysObject dfObj, string attributeName)
{
    int valuesCount = dfObj.getValueCount(attributeName);
    object[] values = new object[valuesCount];

    IDfValue val = null;
    for (int index = 0; index  valuesCount; index++)
    {
        try
        {
            val = dfObj.getRepeatingValue(attributeName, index);
            values[index] = val.asString();
        }
        finally
        {
            NAR(val);
            val = null;
        }
    }
    return values;
}