We want to incorporate flood protection lines (dykes and walls) into our geodatabase (sde).
Our requirements:
My idea:
Problems:
if($feature.Version=='Edit') { return True}return False
if($feature.Version=='Edit') {
return True
}
return False
I found out about the Arcade global variable $originalFeature, which solves part of the second question:
<SPAN class="comment token">// Allow changing the Version from Null to "Edit".</SPAN> <SPAN class="comment token">// This also allows setting the default value of Version to "Edit".</SPAN> <SPAN class="keyword token">if</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="token function">IsEmpty</SPAN><SPAN class="punctuation token">(</SPAN>$originalFeature<SPAN class="punctuation token">.</SPAN>Version<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">&&</SPAN> $feature<SPAN class="punctuation token">.</SPAN>Version<SPAN class="operator token">==</SPAN><SPAN class="string token">"Edit"</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">return</SPAN> True <SPAN class="punctuation token">}</SPAN> <SPAN class="comment token">// Allow changes to the "Edit" version.</SPAN> <SPAN class="keyword token">if</SPAN><SPAN class="punctuation token">(</SPAN>$originalFeature<SPAN class="punctuation token">.</SPAN>Version<SPAN class="operator token">==</SPAN><SPAN class="string token">"Edit"</SPAN> <SPAN class="operator token">&&</SPAN> $feature<SPAN class="punctuation token">.</SPAN>Version<SPAN class="operator token">==</SPAN><SPAN class="string token">"Edit"</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">return</SPAN> True <SPAN class="punctuation token">}</SPAN> <SPAN class="comment token">// Forbid everything else.</SPAN> <SPAN class="keyword token">return</SPAN> False<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
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?
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.