field calculator allows non-domain values

959
1
03-23-2017 04:24 PM
Highlighted
New Contributor III

We have a polyline feature class (in our enterprise sql geodatabase) with a couple attributes that have domains specified. During the usual manual editing of features, it works like a charm - users can only select one of the defined values in the attribute's domain. But the Field Calculator allows any (string) value to be placed in the field, including string values that are neither a domain code nor domain description. I get the same problem in Python code using arcpy.UpdateCursor.  

If somebody starts an edit session, enters invalid attribute values (i.e. non-domain) into ~200 features and then saves the edits and walks away - ArcGIS doesn't even blink an eye. I have to start up the editor again, select those ~200 features (in my case, across 5 feature classes) and then run "Validate Features" to have ArcMap bark at me about "Field xxx attribute value yyy is not a member of coded value domain zzz".

Rather defeats the purpose of using a domained attribute.

What do others do?

Reply
0 Kudos
1 Reply
Highlighted
Regular Contributor

Thanks, I did find something new thinking about your question. I believe there used to be a way to set the option to validate immediately when editing, but I doubt this worked with field calculations.

First, what I do now is summarize my domain-enforced fields periodically and/or do joins to an external domain table (exported from the domain and/or turn the show "display coded attributes..." button on and off in a table. This last method will make all the bad values pop out (because they won't change), assuming your domain description field has a longer/different text than your domain code, which makes them easy to fix.

The new thing: http://desktop.arcgis.com/en/arcmap/latest/manage-data/editing-attributes/applying-the-same-attribut...

You can do quick global edits of domain-enforced fields using a drop down list without using field calculations by using the Editing Attributes window. Maybe you could train some of your editors on this method. I don't use the Attributes window much except for annotation because I don't like looking at records one at a time, so I might never have found this feature.

Reply
0 Kudos