Select to view content in your preferred language

Commit applyEdits FeatureLayer

3497
4
Jump to solution
02-07-2012 06:16 AM
FranciscoBereciartu
Occasional Contributor
Hi all!

I have a FeatureLayer and I have added sucessfully a Feature using "applyEdits" method. I query the feature layer through ArcMap 10 and the record is there, even though when I query the SQL Server directly for the record, the record is not found. Looks like in the SQL Server I see another version of the data or something like that. I'm new to GIS so I don't know if I'm doing something wrong or something is missing. I really appreciated your help!


Thanks in advance.
Frank
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
BjornSvensson
Esri Regular Contributor
Hi Frank,
Is your data "versioned"?
See http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/What_is_a_version/00270000000q000000/ for more info about what "versioned" data is.

View solution in original post

0 Kudos
4 Replies
BjornSvensson
Esri Regular Contributor
Hi Frank,
Is your data "versioned"?
See http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/What_is_a_version/00270000000q000000/ for more info about what "versioned" data is.
0 Kudos
FranciscoBereciartu
Occasional Contributor
Thank you bbjorn, yes, I have versioned data. Your answer was helpful!


I have another question related with with issue. The feature was added sucessfully!. I can query and update teh feature with no trouble at all. The problem comes when I try to delete the feature. I've tried to use the applyEdits method of the FeatureLayer using an array of OBJECIDs ex... [24, 89] featLyr.applyEdits(null, null, [24, 89] ,new AsyncResponder(onResult, onFault)); but it doesn't work.. it always says invalid parameters.... So reading the documentation and forums I found a solution using a FeatureLayerTask... featLyr.applyEdits(null, null, [24, 89], "OBJECTID", new AsyncResponder(onResult, onFault));... It worked very well ... but a couple of days ago the map changed and now uses a version to edit the data besides the "default" version... when I try to delete the feature the applyedits method is called twice... I dont know why... the first response is Ok so the feature was deleted but the second one gives me an error saying the feature do not exits o it was deleted... so my question.. what could change that provoques that the method is called twice ???


Thanks in advance!!!
0 Kudos
ManojNayak
New Contributor
I am new in Flex can you tell me how to add the Feature in my Feature layer, I am trying to add the feature in my feature layer by using "FeatureLayer(mymap.layers).applyEdits(updates,null,null);" but my feature is not created, can u tell any solution.

Thanking you,
Manoj Kumar Nayak
0 Kudos
FranciscoBereciartu
Occasional Contributor
Hi Manoj,

what is the message of the error? When you want to add a feature you use this method "applyEdits([params],null,null,new AsyncResponder(onResult, onFault))".... the first parameter is an array of graphics, and in each graphic you should have attributes according to the fields taht you have in the feauture layer, and the last parameter is the response like i show you before.. you have to create two function to receive the responses from the server and you may see the error in the response from the server. I hope this help

Best Regards
Francisco



I am new in Flex can you tell me how to add the Feature in my Feature layer, I am trying to add the feature in my feature layer by using "FeatureLayer(mymap.layers).applyEdits(updates,null,null);" but my feature is not created, can u tell any solution.

Thanking you,
Manoj Kumar Nayak
0 Kudos