how to set values for last_edited_user from javascript api

11-12-2019 03:42 AM
New Contributor

we have arcgis server 10.6.1 with open rest services, with editor tracking enabled,how to set values for last_edited_user from javascript api.

  1. var userName = "User_Test";  
  2. var userEdits = {  
  3.    created_user: userName,  
  4.    last_edited_user: userName  
  5. };  
  6. on(layer, "before-apply-edits"function(data){  
  7.   data.adds.forEach(function(graphic){  
  8.        lang.mixin(graphic.attributes, userEdits);  
  9.   });  
  10. }); 

once apply edits ,last_edited_user is set with value "esri_anonymous ".

How to set last_edited_user value with username & services are not secured.

0 Kudos
1 Reply
Esri Contributor

It is coming across as `anonymous` because you don't have your service secured. This is how it is able to allow anyone to edit. If you wish to have your data display the name of the responsible editor, you should set it up with security enabled. Without the credentials, it has no way of knowing who the user is that is editing the data.

0 Kudos