Select to view content in your preferred language

Not able to delete a feature for editable feature layer

1788
4
Jump to solution
09-06-2016 01:41 AM
ShaikhRizuan
Regular Contributor

Hi,

I am not able to delete the feature from editable feature layer, While i am able to create and update the feature. Here the scenario is to delete the existing feature and create the new feature and update the attributes. PFB code

var newFeatureLayer = new FeatureLayer(urlparcel);
newFeatureLayer.on("edits-complete", function(evt) {
if(evt.adds.length >0 && evt.adds[0].success == true)
{.....}
else if(evt.updates.length >0 && evt.updates[0].success == true)
{...}

else if(evt.updates.length >0 && evt.updates[0].success == true)
{.....}

});

newFeatureLayer.applyEdits(null, null, [existingFeature]); // existing feature is the selected feature on map load and to be deleted

var newUGraphics = new Graphic(newGeometry); // newGeometry is the new selected geometry and need to be created
newFeatureLayer.applyEdits([newUGraphics],null,null);

The "on edits-complete" event is triggering, when i am trying to create feature but not on deleting the existing feature. And while creating feature in "edits-complete" function , though it smoothly creating the feature but one error occurred at console "init.js:182 Error: Unable to complete operation."  I believe this is the error for delete operation which was not happened properly.

Please help me on how the feature has to deleted from editable feature layer.

 

Thanks,

Shaikh Rizuan

0 Kudos
1 Solution

Accepted Solutions
ShaikhRizuan
Regular Contributor

It starts working when the new feature is created first and then deleteting the existing one.. earlier i way trying to delete first then creating the feature.

I don't  know what may be the issue, if i delete the feature first and then create.

View solution in original post

0 Kudos
4 Replies
by Anonymous User
Not applicable

Hello,

Please check your feature service

to active delete in feature services required to marked as active...

0 Kudos
ShaikhRizuan
Regular Contributor

Yes it is there...

0 Kudos
ShaikhRizuan
Regular Contributor

It starts working when the new feature is created first and then deleteting the existing one.. earlier i way trying to delete first then creating the feature.

I don't  know what may be the issue, if i delete the feature first and then create.

0 Kudos
by Anonymous User
Not applicable

Can you please close this thread and mark as answered...