Unable to apply edits

16853
28
Jump to solution
12-13-2011 09:19 AM
JamesWhisenhunt
New Contributor III
I am trying to create an application similar to the ESRI citizen request sample.  I am running into a problem where I am unable to apply my edits.  The error code is:

{"error":{"code":400,"message":"Unable to complete  operation.","details":["Unable to apply edits"]}}

I have:


  1. registered the feature class as versioned

  2. permissions have been given. I am able to edit without problem in ArcMap; is there something else I need to do.

  3. checked to make sure editing is enabled on the service

Any help is greatly appreciated.
James
0 Kudos
28 Replies
LisaT
by
Occasional Contributor III
HI, I am hoping that there are a few still watching this thread.  I can query my featureserver and get results, but I cannot apply edits.  I have tried "updateFeature", "deleteFeature", and "applyEdits" (with deletes and adds...together and separately).  I just get a general "unable to apply edits" error on all attempts except for "updateFeature" during which I get an "Invalid graphic features" error.  I am going to start focusing on deletes, just so that I am making things a little easier.  My URL ends up being:
          'myserveraddress/deleteFeatures?objectIds=4'
or

          'myserveraddress/applyEdits?deletes=7'

the server address that I am using is the same one I am using to query (which works) so I am sure it is set up correctly.

This is a point featureclass in an SDE UNVERSIONED database (all documentation says I should be able to use unversioned), OS authentication, privileges are set up for ARCGISSOC, ARCGISSOC has been granted all rights in SQL, ARCGISSOC has full control over the cache folder and the database folder.

I have also deleted all fields out of the featureclasses except for a simple text field, as I have had trouble with date fields in the past on other issues, and am trying to simplify as much as possible.  The featureclass has about 300 point features in it.

I have tried everything I have found in the posts.  Does anyone (ESRI?) have any ideas on what else I can try?  Does anyone see anything wrong with the parameters I am sending with the URL?  I am not sending via proxy, at this time.
0 Kudos
LisaT
by
Occasional Contributor III
I have found more information on the errors I am getting...an "invalid operation" is being thrown in each case (see the log files below).  Any ideas why the operation cannot be found?  I am using the javascript REST API with Google Extension.  Is there something I need to add to my library for version 10?  The query works on featureserver, just not updatFeatures, deletefeatures, or applyedits.  I use the "getJSON" method in "arcgislink" to send the command.  Any suggestions for a different way to do this?  The featureservice is currently a dynamic service with only 3 fields (objectid, shape, and name).  It shows up correctly in the services directory under the arcmap and javascript views. 

Any ideas??




Here are the logs:

Log Entry : 1/19/2012 8:29:07 AM
  ERROR:Unable to update features
  http://myserver/ArcGIS/rest/services/Reference_Stations/thefeatServ/FeatureServer/0/updateFeatures?features=[]&callback=ags_jsonp.ags_jsonp_39_200002&f=json
  :Exception of type 'System.InvalidOperationException' was thrown.
-------------------------------

Log Entry : 1/19/2012 8:29:08 AM
  ERROR:Unable to apply edits
  http://myserver/ArcGIS/rest/services/Reference_Stations/thefeatServ/FeatureServer/0/applyEdits?deletes=7&callback=ags_jsonp.ags_jsonp_41_323756&f=json
  :Exception of type 'System.InvalidOperationException' was thrown.
-------------------------------

Log Entry : 1/19/2012 8:40:12 AM
  ERROR:Unable to delete features
  http://myserver/ArcGIS/rest/services/Reference_Stations/thefeatServ/FeatureServer/0/deleteFeatures?objectIds=4&callback=ags_jsonp.ags_jsonp_30_324305&f=json
  :Exception of type 'System.InvalidOperationException' was thrown.
0 Kudos
MOHANA_KRISHNAPUNNAM
New Contributor II
Hello,

I don't know if any of this will help, but I had problems (and still do) with editing.
In order for my edits to work there are 2 things I must do.

1.  Ensure my layer in SDE was created by manually adding the fields, and NOT by loading in a layer from shapefile or another SDE layer.  It's crazy, and ESRI can't reproduce this behaviour, but it's true for me, I have to create a new feature class and add the fields one by one with ArcCatalog rather than importing the fields.

2.  My layers in my MXD feeding the service must connect to SDE using an SDE service and NOT with Direct Connect.

It took me ages to work these out and get my editing working, but so long as I do the above in addition to the usual stuff then I can get it to work.

Mark.



2. I have connected the layers with direct connection (no sde service). I can edit the features using feature service

Mohan
0 Kudos
JadeFreeman
Occasional Contributor III
I know this is an older thread but I ran into the same issue today trying to use the Flex API (3.0) FeatureLayer.applyEdits().  It always fails.  I used ServiceCapture to grab the parameters sent to the service and when I use the FeatureServer/tableId/applyEdits REST page, I also get an error.  However, when I take the updates array from the request and use the http://myserver/arcgis/rest/service/featureserver/tableid/updateFeatures REST page, it works just fine!

I'll check to see if this was addressed in a service pack tonight.

Hopefully this helps someone!  I've spent all day trying to chase this down...
0 Kudos
AdrianMarsden
Occasional Contributor III
Hi - I was (and still am) getting the "Unable to complete operation." error.  It turns out that I simply cannot do any edits as long as I am on SDE 9.3.1

http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//00930000000m...


ArcGIS Server 10 introduces feature services, which expose access to vector feature geometries and attributes. A great benefit of feature services is the ability to expose feature editing through JavaScript, Flex, and Silverlight applications. Feature services are published from map documents, and the source datasets are required to reside in a single ArcSDE geodatabase.



So it is worth checking yours - we cannot upgrade as we still have a 3rd party MapObjects application

ACM
0 Kudos
JadeFreeman
Occasional Contributor III
We are on 10.0 and using direct connections to our Oracle database so I don't think that's the issue. 

Since yesterday, I've checked a number of things that searching the forums revealed might be problems and have been able to rule them out:

  • OBJECTID being sent as a string

  • Using FeatureLayerTask rather than FeatureLayer (my application is trying to update a stand alone table)

  • Date/Time fields removed

At this point, I've created a class that wraps HTTPService to make calls to the ../FeatureServer/table_id/updateFeatures endpoint and it works great.  All efforts to use FeatureLayer/FeatureLayerTask.applyEdits() fail.  Also, the ../FeatureServer/table_id/applyEdits end point fails when I provide the exact same json structure which succeeds at the /updateFeatures endpoint which seems to lend itself to this being an issue with the server, rather than the web API's, but who knows?

BTW, I have several iPad maps that can update features in different services with no problem...
0 Kudos
ChrisMusial
New Contributor
I've been getting this error using the Javascript API when trying to update a feature - I was able to add one fine but could not update it.

Finally found the reason (in my case anyway), so I thought I'd pass it on.

The OBJECTID attribute needs to be a number.  I was doing an identify, grabbing the feature that was returned, changing one of the attributes, and using FeatureLayer.applyEdits:
  featLayer.applyEdits (null, [feature], null);

However if I converted the OBJECTID to a number first it worked fine:

  feature.attributes['OBJECTID'] = Number(feature.attributes['OBJECTID']);
  featLayer.applyEdits (null, [feature], null);

Hope this helps someone out there.

Chris
0 Kudos
LucaSimone
New Contributor III

  feature.attributes['OBJECTID'] = Number(feature.attributes['OBJECTID']);
  featLayer.applyEdits (null, [feature], null);


you saved my day! Thx
0 Kudos
DublinOhio
New Contributor III

We were getting the "Update Failed" message in Collector on iOS 8 whenever we tried to edit a feature in a polygon layer.  The only solution we were able to come up with was to republish the service with geometry editing disabled.  You're then able to update the attributes successfully.  Hopefully this issue can be addressed in a future version of Collector.  For what it's worth, the green Esri iOS app exhibited the same behavior.

0 Kudos