Hi. I'm wondering if we missed a step when updating the fields in a hosted feature layer we're editing. We deployed the hosted feature layer using a file geodatabase and ArcMap. After we added a few features, we decided we didn't need one of the fields so we deleted it through AGOL. Now, when we try to create a new feature we get an error. Well, when editing through the AGOL map viewer, there is no error; the feature just disappears from the map and is not added to the layer. In ArcGIS Pro, an actual error is captured - "failed to create new feature(s). General function failure [Invalid column name 'Type'.]"
"Type" is the field we deleted.
The field does not show up anywhere (e.g. popups, REST point, Data tab, exported).
Any information or ideas are appreciated to help us understand what's happened (so it doesn't happen again) and how to fix this data.set.
Thanks.
Do you know if you have any definitionExpression on the layer that reference the "Type" field? deleting a field that is referenced by the definition expression would cause issue like what you are seeing. Also do you know if updating a feature works?
I have just tried deleting a field and I have no issue adding features. So it might be either related to the definitionExpression or server cache issue. Updating anything in the layer would clear the cache if it is cache issue.
Also would be good to know how you deleted the field? did you use the UX or from the REST admin API?
You can always delete a field using the layer admin API:
rest/admin/services/<myService>/FeatureServer/<layerId>/deleteFromDefinition
{
"fields" : [
{
"name" : "<fieldName"
}
]
}
Thanks
Khaled Hassen
Online Feature Service Dev Lead
Definition expression? not sure what this is? but I have the same problem, i would like to eliminate a field because it is no longer useful, but I get the same error message
Did anyone every figure out a solution for this error? We have ran into this on multiple occasions and have not been able to fix it short of republishing the entire layer (not ideal). There is no way to reliably reproduce it. But it does happen. And there is no def expression on these layers for me.
Will be good if you can send the layer url. The most common issue is that you have set a definition expression on the layer and then you have deleted the field referenced by that expression.
Khaled Hassen
Online Feature Service Dev Lead
Unfortunately we had to republish the layer to fix this so I don’t have a broken example at the moment. I can verify we did not have a Def Expression set on the item. Next time it happens I will try and reach out with an example.
I also had this issue following deleting a field. Super annoying!
For me it manifested when trying the edit values for another field after the field deletion. I am pretty sure I deleted the field using AGOL, but also had the feature layer open in ArcGIS Pro.
I have resorted to republishing and am hoping this doesn't occur again.
Has anyone come up with an answer to this? I optimized the layer and opened the data in a new pro document and I still get "Save edits failed. General function failure." With a list of my deleted fields. I can export the data and reload it, but that seems a bit cumbersome.
Just in case anyone else happens upon this thread, I found the solution (you need to uncheck ALL the options under editing): https://community.esri.com/t5/arcgis-online-questions/error-editing-data-after-dropping-field-from/m...
This should probably be accepted as an answer. Thanks for sharing.