Select to view content in your preferred language

copy feature from one layer to another

06-19-2016 12:14 AM
Occasional Contributor

I have two feature  layers layer1 & layer2. I want to copy a feature from layer1 to layer2  and chnage its attributes as per layer2. I had already created a graphic from layer1. Layer2 is published as  Featureservice.  What I am trying to do is select the feature from Layer1 as graphic, and trying to do ApplyEdit (graphic to Layer2) is this the right way? But it fails. I meanLayer2 is not updated in the Geodatabase. I am using the following code to make the edits,  as suggestion from ArcGIS javascript forum Girish Yadav.

var newFeature = new Graphic(graphic.toJson());

featureLayer.applyEdits([newFeature], null, null) The

Environement : Javascript API 3.16 ArcGIS Server 10.0 ArcSDE GeoDatabase 9.2 Oracle database

0 Kudos
0 Replies