applyEdits in 4.10

724
4
Jump to solution
12-19-2018 09:27 AM
MichaelLodes2
Occasional Contributor

Hi,

short question about a problem I faced when migrating from api version 4.9 to 4.10. With the script below i update the attributes of a feature (in agol feature service) when running the script. In 4.9 it worked fine but it doesn't in 4.10, without any errors. I checked the release notes but couldn't find any breaking changes related to that topic. Thanks!

<script>
            require([

                    "esri/layers/FeatureLayer",
                    "esri/Graphic",
                    "dojo/domReady!"
                  ], function (FeatureLayer, Graphic
              ) {




                var lyr = new FeatureLayer({
                          url: "https://services6.arcgis.com/..../arcgis/rest/services/Strassenbeleuchtung_Development/FeatureServer",
                          objectIdField: "FID",
                          outFields: ["*"]


                        }); 
                        
                var updateFeatArr = [];       
                updateFeatArr.push(new Graphic({
                  attributes: {LAMPENNUMM: "2", ARTVALUE: "LED", FID: 3}}));

                    return lyr.applyEdits({

                      updateFeatures: updateFeatArr

                    })
                .then(function(results) {
                });
            });
</script>
0 Kudos
1 Solution

Accepted Solutions
BjornSvensson
Esri Regular Contributor

Michael Lodes‌ - this was a 4.10-specific bug about applyEdits not working unless the geometry was specified. This has been fixed.  Could you give this another try and see if it works fine for you now using https://js.arcgis.com/4.10/ ?

View solution in original post

0 Kudos
4 Replies
BjornSvensson
Esri Regular Contributor

Michael Lodes‌ - this was a 4.10-specific bug about applyEdits not working unless the geometry was specified. This has been fixed.  Could you give this another try and see if it works fine for you now using https://js.arcgis.com/4.10/ ?

0 Kudos
MichaelLodes2
Occasional Contributor

Thank you Bjorn, now it works fine.

Best Regards,

Michael

0 Kudos
TamarLevy
New Contributor

Hi Bjron,

I use a local copy of the 4.10 API and I encountered in the same bug, the online 4.10 nodules work but I need a local API. Can you add the fix to the API in this page - ArcGIS for Developers?

Thanks in advance,

Tamar

0 Kudos
BjornSvensson
Esri Regular Contributor
0 Kudos