I'm trying to write a new domain and values in our ArcSDE database but I receive the following error:
Runtime error Traceback (most recent call last): File "", line 34, in File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 1317, in AddCodedValueToDomain raise e ExecuteError: ERROR 000800: The value is not a member of Gas Service Diameter Plastic PVC | Rectifier Manufacturer | Work Order Status | GasASTMF2897CSteelPipeType | Pipe Diameter Plastic PVC | Leak Survey Frequency..
Line 34) arcpy.AddCodedValueToDomain_management(gdb, domName, code, domDict[code])
Notes: The domain name is successfully created in the enterprise geodatabase but the coded values return an error.
Current ArcSDE Enterprise Geodatabase Version: 10.3.1.
Code:
#Import system modules import arcpy arcpy.env.workspace = "C:/Users/jnmiller/AppData/Roaming/ESRI/Desktop10.3/ArcCatalog" # Set local parameters domName = "test123" gdb = "GIS.sde" # Process: Create the coded value domain arcpy.CreateDomain_management(gdb, domName, "Description", "TEXT", "CODED") # List of domain values in load order domainList = ["1"] # Store all the domain values in a dictionary with the domain code as the "key" and the # domain description as the "value" (domDict[code]) domDict = {"1":"test 1"} # Process: Add valid material types to the domain # use a for loop to cycle through all the domain codes in the dictionary for code in domainList: arcpy.AddCodedValueToDomain_management(gdb, domName, code, domDict[code]) print "Finished!"