Good Morning,
I have the following piece of code that runs correctly on my development machine:
drawToolbar.on('draw-end', lang.hitch(this, function(evt) {
drawToolbar.deactivate();
this._editToolbar.deactivate();
var fieldName = this.easementIdFieldName;
var attr = {};
attr[fieldName] = this._easementId;
var newGraphic = new Graphic(evt.geometry, null, attr);
this._easementLayer.applyEdits([newGraphic], null, null);
}));
It produces an applyEdits operation with the following form data:
f:json
adds:[{"geometry":{"rings":[[[-17575293.21213455,2433436.9187920587],[-17575121.228820905,2433112.061421838],[-17575321.87602016,2433064.2882791585],[-17575474.750076734,2433214.773678599],[-17575293.21213455,2433436.9187920587]]],"spatialReference":{"wkid":102100,"latestWkid":3857}},"attributes":{"EasementId":"25"}}]
The feature layer gets updated with the new feature, including attribute data.
When I move the app to my web server without changing any code the attributes disappear from the applyEdits operation.
The newGraphic variable is created correctly with the attribute parameter but it doesn't show up in the applyEdits form data:
f:json
adds:[{"geometry":{"rings":[[[-17579178.857595254,2454963.389069852],[-17579637.479764964,2449842.108174752],[-17580707.598160956,2452823.1522778696],[-17579178.857595254,2454963.389069852]]],"spatialReference":{"wkid":102100,"latestWkid":3857}},"attributes":{}}]
The feature layer gets updated with the new feature but without the attribute.
Javascript 3.2. ArcGIS Server 10.4.1.
Any ideas?
Many thanks!
Jill