Here is a snippet of code where I manually set the Editor Tracking user info. When I look at the request being sent to the server all Editor Tracking fields were removed from the graphics.
var userName = "Alex Magruder";
var userEdits = {
created_user: userName,
last_edited_user: userName
};
on(layer, "before-apply-edits", function(data){
data.adds.forEach(function(graphic){
lang.mixin(graphic.attributes, userEdits);
});
});
Graphic after before-apply-edits | ApplyEdits request form data |
---|
{"attributes":{
"OfflineID":null,
"Comments":null,
"Value1":null,
"created_user":"Alex Magruder",
"last_edited_user":"Alex Magruder"
}} | {"attributes":{
"OfflineID":null,
"Comments":null,
"Value1":null
}} |