Roxanne,
OK, here is the issue.
This is the whole function:
function _getCodedValue(layer, fieldName, fieldValue, typeID) {
var result;
var codedValueDomain;
if (typeID) {
var featureType = this._getFeatureType(layer, typeID);
if (featureType) {
codedValueDomain = featureType.domains[fieldName];
}
} else {
var field = this._getField(layer, fieldName);
if (field) {
codedValueDomain = field.domain;
}
}
if (codedValueDomain) {
if(codedValueDomain.type === 'codedValue'){
for (var cv = 0; cv < codedValueDomain.codedValues.length; cv++) {
var codedValue = codedValueDomain.codedValues[cv];
if (fieldValue === codedValue.code) {
result = codedValue;
break;
}
}
}
}
return result;
}
and this is how you call it:
var codedValue = _getCodedValue (VideoCamera, "The field name as a string", "this is the value you have for that fields attribute");