We want to incorporate flood protection lines (dykes and walls) into our geodatabase (sde).
Our requirements:
My idea:
Problems:
It works with responsible users, but an irresponsible user could still change the value of Version to 'Edit' and edit the feature. They can't change the value back to the original version, so it's the equivalent of deleting the feature from the version. Also, with this code I have to disable the rule to change all 'Edit' features to a new uneditable version.if($feature.Version=='Edit') {
return True
}
return False
I found out about the Arcade global variable $originalFeature, which solves part of the second question:
// Allow changing the Version from Null to "Edit".
// This also allows setting the default value of Version to "Edit".
if(IsEmpty($originalFeature.Version) && $feature.Version=="Edit") {
return True
}
// Allow changes to the "Edit" version.
if($originalFeature.Version=="Edit" && $feature.Version=="Edit") {
return True
}
// Forbid everything else.
return False
With this code, users can't edit old versions. I still have to disable the rule to change the edit version into an uneditable version, but that has to be done quite rarely, so that's fine.
That leaves only the first question: Is there a way to do something like this without using Attribute Rules?