Select to view content in your preferred language

Solved: Problem Updating ArcGISFeatureLayer

1938
1
Jump to solution
01-31-2013 05:38 AM
KevinGebhardt
Deactivated User
Hello,
I have a problem when i'm trying to update my featurelayer after changing the position or some attribute values of a feature.
Here is my code:
First i'm retrieving the updated graphics from my local database:
ArcGISFeatureLayer syncLayer = new ArcGISFeatureLayer("http://<server>/ArcGIS/rest/services/<directory>/<service>/FeatureServer/0",o,cred);      
edits = builder.getBaumdatenAsGraphic(getApplicationContext(), "1",new Hashtable<String,Object>());

In this method im filling the Hashtable with values:
map.put("OBJECTID", baeume.get(i).getOBJECTID());
map.put(BK_BAEUME_ADATUM, baeume.get(i).getADatum());

And afterwards i'm generating the Graphic:
InfoTemplate info = new InfoTemplate();
graphics = new Graphic(new Point(baeume.get(i).getX(),baeume.get(i).getY()),pms,map,info);

Then i'm calling applyEdits from my FeatureLayer:
syncLayer.applyEdits(adds, deletes, edits, new CallbackListener<FeatureEditResult[][]>(){
// some Callback-Handling
});

On my device i get now the message:
[objectid=-32648,globalid=null, success=false,error=FeatureEditError[code=-1, description=Update for the object was not attempted. Object may not exists.]]
It's possible that the objectid is incorrect? I retrieve it from the featurelayer when initializing the data.

Thanks in advance
0 Kudos
1 Solution

Accepted Solutions
KevinGebhardt
Deactivated User
I solved my problem:

map.put("OBJECTID", baeume.get(i).getOBJECTID());

the ObjectID in my local Data was String and not integer.

After fixing it, it works

View solution in original post

0 Kudos
1 Reply
KevinGebhardt
Deactivated User
I solved my problem:

map.put("OBJECTID", baeume.get(i).getOBJECTID());

the ObjectID in my local Data was String and not integer.

After fixing it, it works
0 Kudos