Hi, Im trying to create a constraint that prevents a field (name_id) from being edited
I can't figure out what's wrong with this statement:
if ($feature.name_id !=$feature.name_id)
{
return false;
}
else
return true;
Thanks for the help!
Solved! Go to Solution.
Do you have more information about the issue, what is wrong with the script, or what the behavior of the script is unexpected?
Based on a cursory glance, I think you should be using the $originalfeature global to check if the edit that triggers the rule is changing the attribute for that field (name_id).
if ($feature.name_id !=$originalfeature.name_id)
Check out the blog here to learn more about the $originalfeature https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/originalfeature-new-attribute-r...
Do you have more information about the issue, what is wrong with the script, or what the behavior of the script is unexpected?
Based on a cursory glance, I think you should be using the $originalfeature global to check if the edit that triggers the rule is changing the attribute for that field (name_id).
if ($feature.name_id !=$originalfeature.name_id)
Check out the blog here to learn more about the $originalfeature https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/originalfeature-new-attribute-r...
Thanks, thats exactly what I was looking for!