I am looking to change versions of an .sde through Arcpy to then afterwards, run a few geoprocesses on it. I do not want it to automatically update after that.
So far I have managed to create a version through ArcPy, but I can't for the life of me figure out how to connect to it. The "Changeversion_management" only does this on 1 feature class and keeps throwing me errors such as the following:
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Feature Layer or Table View: Dataset [email protected] does not exist or is not supported
Failed to execute (ChangeVersion).
And
ERROR 000800: The value is not a member of ZN_KGD.ExPimp_p9 | ZN_KGD.Tool_test
Failed to execute (ChangeVersion).
I would like to change the version of all the feature classes in the TOC, or at least connected to the same .sde. The script I am using to create and change the version is the following:
import arcpy
Project_number = arcpy.GetParameterAsText(0)
inWorkspace = "C:/Users/Lansr/AppData/Roaming/ESRI/Desktop10.3/ArcCatalog/[email protected]"
parentVersion = "ZN_KGD_DIENSTVERSIE"
# Execute CreateVersion
arcpy.CreateVersion_management(inWorkspace, parentVersion, "ExPimp_{}".format(Project_number), "PUBLIC")
arcpy.ChangeVersion_management('ZN_KGD.ZN_KGD_DIENSTVERSIE',
'TRANSACTIONAL',
"ExPimp_{}".format(Project_number),
'')
The feature layer and sde are not defined in the script, but are purely in the TOC.
It is important to note that the top error happens when I fill in the name of the .sde and the bottom error happens when I fill in the name of a feature layer. My knowledge of ArcPy is limited at best. I am using ArcGIS 10.3.1.
Deklaag_vlakken
and[email protected]
are defined.