UpdateFeatures: Object is Missing
I'm using a QueryTask activity to create a featureset from a feature service. Then I'm making some changes to the attributes' values and saving it back to the feature service.
The UpdateFeatures activity is returning an error. In Fiddler this was showing as an error 500. ArcGIS Server's log was showing an error but not being specific. In the end I took set the ArcGIS Server log to 'FINE' level and take the JSON message shown there, copying it into the REST endpoint of the feature service's Update Features operation. Only then did I get the actual error message, which was: Unable to complete operation. Object is Missing.
It turns out that in my workflow the OBJECTID field has been changed from an integer to a string. (In the feature service its type is: type: esriFieldTypeOID, which is an integer.) I didn't change the field type myself, Geocortex did.
So then I tried adding a new integer field to my featureset and setting that as the Object Id field, but the UpdateFeatures activity also converted this to a string.
It seems that the UpdateFeature activity changes all the attributes to strings. Hence it will fail if the OBJECTID field in the feature service is an esriFieldTypeOID.
This would seem to be a bug in Geocortex. Is there a workaround?
-
Yes I've seen this also. In my opinion this is a bug.
My workaround is to explicitly convert the ObjectID to an integer value (with CInt or a similar function).
0 -
Hi Nico
Thanks for the confirmation. I have tried changing the ObjectId to an integer by using the cint() function, but then the UpdateFeatures activity changes it back to a string.
How did you manage to ensure that it remained an integer?
Thanks
Mark
0 -
Can you post the workflow here or send it to me, nico.burgerhart(at)grontmij.nl
0 -
Thanks, Nico, for your help with this and for emailing me the sample code.
In my workflow I was creating a new graphic object from the featureset and setting its attributes. I was doing this under the assumption that the UpdateFeatures activity needed a Features collection object (as it states in the Help for this activity, and if you get the workflow to create a new variable for you for this parameter this is the type of variable it creates).
However I have found that by using a Featureset object in the UpdateFeatures activity instead that I can save directly back to the feature set. It looks like this activity can take either a Featureset object or a Features collection object, even though this is not stated in the help.
I have recommended to Latitude that they update the documentation accordingly to indicate the different data types this parameter can take.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
4 Kommentare