Local geodatabase uses default values instead of attribute values passed in

2481
1
08-16-2015 05:35 PM
PaulHaakma
Regular Contributor

Hi all. Just wondering whether anyone else has experienced this or could test and see if can replicate this issue.

I have a feature service where some fields have default values as set in arccatalog. In my app I create a FeatureLayer, which points to a GeodatabaseFeatureServiceTable when online and a GeodatabaseFeatureTable pointing to a local geodatabase when offline.

Here's the interesting bit: I create a new feature, give it a geometry and set the attributes. When online it commits the edits fine with no issues. When offline and/or using the local geodatabase/table, any attribute fields that have a default defined use that default instead of the attribute value passed in to it. Any attribute fields that don't have a default set correctly use whatever value I've passed in.

As a temporary workaround I have gone through and removed all the defaults at the database level and it works fine, but this is not ideal.

Any input or feedback from other users would be helpful to identify if this is a bug that needs to be investigated or not.

Cheers,

-Paul

0 Kudos
1 Reply
MarikaVertzonis
Esri Regular Contributor

Hi Paul

We did some research and confirm that if a feature service has a default value set for one of the attributes field, and you try to set an attribute value for that field, it always sets it to the default value. This is true when you set the attribute value while creating a feature.


However, if you update the feature by calling FeatureTable.UpdateFeature it will get updated with whatever value you set for the field.

Regards, Marika

0 Kudos