AnsweredAssumed Answered

before-apply-edits server error

Question asked by MRKomp on Jan 31, 2017
Latest reply on Feb 6, 2017 by MRKomp

Hello all,

 

I've implemented the following code using a before-apply-edits on a layer, however I get an error when I try to apply those changes I made using a geometry service. The server does send an error 17000 on the Method "GraphicFeatureServer.HandleREST_ApplyEditsOperation". Any help is much appreciated. This is a head scratcher for me.

 

          forage.on("before-apply-edits", function (evt) {
                if (evt.adds != null){
                

 

                console.log("QueryRunning");
                var query = new Query();
                query.outSpatialReference = map.spatialReference;
                query.geometry = evt.adds[0].geometry;
                query.spatialRelationship = Query.SPATIAL_INTERSECTS;
                
                var feat = evt.adds[0];
            
                property.queryFeatures(query, function(featureSet) {
                    if (featureSet.features.length == 0) {
                    }
                    else {
                        console.log("pboundary detected");
                        console.log(evt.adds[0]);
                        
                        var intersectGeometry = feat.geometry;
                        var queryGeometry = featureSet.features[0].geometry;
                        var newGeom = geometryEngine.intersect(intersectGeometry, queryGeometry);
                        feat.setGeometry(newGeom);            
                        console.log(feat.geometry);
                        forage.applyEdits(null, [feat], null);

                    }
                    });
            }
            });

Outcomes