Feature Update ApplyEdits via GlobalID?

785
3
03-30-2020 07:12 AM
PaulVepraskas
Occasional Contributor

Due to a bug in Dashboard I need to be able to do updates to attributes without an objectid.  So I changed my services to be "Supports ApplyEdits With Global Ids: true" but every time I try and do an applyEdits update of a feature with the globalid the error I am getting is "ObjectId field is missing."?????

Anyone have a suggestions?

Code below would work with Objectid

var gUPDATE = {attributes: {GlobalID: "{A40352E3-0C1E-4A65-AAE7-106B4D79F131}", STATUS: "Pending"}};
featureLayer.applyEdits(null, [gUPDATE ], null, function (response) {
console.log("done");
});

0 Kudos
3 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

Seems like you are using 3.x API to edit features using globalIds. 3.x FeatureLayer.applyEdits does not support globalIds. This functionality will be supported at 4.15. 

-Undral

0 Kudos
PaulVepraskas
Occasional Contributor

K so any idea when 4.15 will be released?

0 Kudos
UndralBatsukh
Esri Regular Contributor

It will be released towards end of next week. You will see announcement here on geonet when it becomes public. In meantime, you can test this functionality using our next version. 

Please take a look at this test app to see how globalIds are used with FeatureLayer.applyEdits. It is not the most intuitive app but will get the concept across. 

To add a new features, click on the `Add Feature` button, then click on the map, change the severity value and provide a globalId for your new feature and finally click on the `Apply Edits` button. 

To update an existing feature, click on a feature on the map, then change the severity value, click on the update feature button and finally click on the Apply Edits button. 

I would like to point out that globalIds are supported for update and add operations for applyEdits. For delete operations you must use the objectIds. This will become available at 4.16. 

Hope this makes sense,

-Undral

0 Kudos