Good Morning,
I have the following piece of code that runs correctly on my development machine:
drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">on</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'draw-end'</SPAN><SPAN class="punctuation token">,</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hitch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN><SPAN class="punctuation token">(</SPAN>evt<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">deactivate</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>_editToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">deactivate</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> fieldName <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>easementIdFieldName<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> attr <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN>
attr<SPAN class="punctuation token">[</SPAN>fieldName<SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>_easementId<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> newGraphic <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Graphic</SPAN><SPAN class="punctuation token">(</SPAN>evt<SPAN class="punctuation token">.</SPAN>geometry<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">,</SPAN> attr<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>_easementLayer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">applyEdits</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN>newGraphic<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>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