I use coded domains for all of my streets (900+ records - don't judge me). When I need to add a new street to the domain table, I want to use the next available number. I know I can sort by code, scroll down to the end and add one to the last number for my new record.
My question is how do I avoid duplicating a number in the coded value field that is already being used?
I tested what might happen by adding a new record duplicating and existing coded value. I was surprised I didn't get a popup warning me I was violating data integrity. I believe what happens is that the original coded value gets deleted.
How are you trying to 'add' it? Pro warns me and greys out the save button if I have duplicates.
R_
I go to the bottom of the list of domains, add a new record
and click the Save button. The save takes.
Then when I query the coded value in a feature class and the new domain value shows.
Then I close/open the domain table and "WALLINGFORD LINE" is gone and only "test" remains:
OIC, I learned decades ago to not use numeric Domains for text fields in ESRI (mainly for lookup issues across software/platforms, but now yet another reason), so when I saw street names (though you clearly mentioned the number), didn't think to test that.
However, using numeric fields I can reproduce your issue in both 2.9.3 and 3.1.1.....
If I set up a domain with Long/Short, add an existing domain to it and save, it WILL overwrite the current value with no error/warning at all.
Probably best to start a tech support call with ESRI on this so it can get in the que to eventually, maybe, think about fixing it.
R_
@RhettZufelt I appreciate you taking the time to look into this and identifying the underlying issue. I will start a tech support case and follow-up here if anything comes of it.
Upon furthur testing, I see both the GP tool (Table to Domain) and arcpy.management.TableToDomain both work as expected, and will give an error if you try to append a duplicate domain value.
Might be a workaround in the meantime.
R_
Yes, this is a good workaround. I can setup a temp table to be used with Table to Domain and append it to the appropriate domain as needed.
Here's the error I got doing Table to Domain (append) that I would expect if I were simply editing an existing domain value. Thanks again @RhettZufelt.
ESRI has escalated this to #BUG-000158369