Select to view content in your preferred language

Editor widget applyEdits error (Dev Edition 1.11)

1907
13
03-27-2023 07:33 PM
LeonAus
New Contributor III

I'm wondering if I'm getting this error because of something I've miss configured or it's a bug.

I've installed the Dev Edition 1.11 and am testing out the Editor Widget. I've setup my layers and in testing a first edit I get this error:

0: "Error: Combination of parameters rollbackOnFailure = false & returnServiceEditsOption = originalAndCurrentFeatures for applyEdits operation is not supported."

extendedCode: -2147467259

message: "Unable to complete operation."

Looking at the body of the request:

LeonAus_0-1679970155186.png

and the documentation of applyEdits, the originalAndCurrentFeatures option is only valid when rollBackOnFailure is true. As rollBackOnFailure isn't being set in the request, I'm guessing it's defaulting to false, which is causing my error.

Is there a way I can get the Editor Widget to send the rollBackOnFailure parameter as true without customizing?

My edit layer is an ArcGIS Server 10.9.1 Feature Service with the data in an Enterprise Geodatabase.

13 Replies
MichailMarinakis1
Occasional Contributor II

I am having exactly the same issue with ArcGIS JavaScript 4.26.5! Did you manage to solve this? 

I have noticed that they have included returnServiceEditsOption: "original-and-current-features" in the EditorViewModel.js during the applyEdits. This is the case if the feature layer is using a URL and not a portaItem? There is some logic to test if the layer is a hosted one, or in AGOL. We are using the feature layer by loading a URL since we have an standalone ArcGIS Server. We also have an enterprise Portal and load the layer again with the url.

@JoseBanuelos , @ReneRubalcava , please let us know about any feedback!

Thank you!

 

EDIT: we downgrade to version 4.26.1 and it works fine 😅

LeonAus
New Contributor III

I ended up getting around it with an interceptor, but was hoping not to have to make a custom widget to get around it long term.

 

esriConfig.request.interceptors.splice(0, 0, {
      urls: "https://<FeatureServer URL>",
      before: function(params) {
        if (params.requestOptions.query.returnServiceEditsOption && params.requestOptions.query.returnServiceEditsOption === "originalAndCurrentFeatures") {
          params.requestOptions.query.rollbackOnFailure = true;
        }
      }
    });

 

MichailMarinakis1
Occasional Contributor II

Nice approach! Thanks for the response 

0 Kudos
PaulHickson1
Esri Contributor

@LeonAus  

 I don’t fully understand the interceptor and the before interceptor call back parameters https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#BeforeInterceptorCall...

 

Do I need to set the parameters? I’ve tried using the code you have but this doesn’t seem make any difference to the editor widget.

Paul Hickson
0 Kudos
LeonAus
New Contributor III

You should only need to update the urls string with your FeatureServer endpoint, then add the code to the right spot in a cloned editor widget in ExB Dev Edition.

That's why I did anyway. If you're using a different app or different version then it will be a slightly different process.

0 Kudos
RyderRoss
New Contributor II

We're also seeing this with Server 10.9.1 w/ data in an Enterprise Geodatabase. We're not using Experience Builder but are using the JS SDK directly. I was able to apply the interceptor to fix the issue. Posting here mainly to subscribe but also to validate that this issue still exists. 

QuantitativeFuturist
Occasional Contributor

Esri are aware of this bug but unwilling to fix or communicate the issue to users. This cannot wait for the next release cycle and should be applied as a hot fix. Typical esri unfortunately.

0 Kudos
PaulHickson1
Esri Contributor

With the comment above you have suggested esri are aware.  Do you have a bug number that they have supplied ?

Paul Hickson
0 Kudos
Anne_F
by Esri Contributor
Esri Contributor

I can not find this bug in ESRIs systems, do you buy any chance have the bug-number or title? 😊

 

Anne

0 Kudos