Hello All,
I'm trying to update one attribute value using Polygon Area in Edit Widget. I'm using before-apply-edits event to do so. For calculating area of polygon I'm using geometry service. Please find the code below:
onBeforeApplyEdits<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>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>evt<SPAN class="punctuation token">.</SPAN>adds <SPAN class="operator token">!=</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">var</SPAN> feat <SPAN class="operator token">=</SPAN> evt<SPAN class="punctuation token">.</SPAN>adds<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> geometry <SPAN class="operator token">=</SPAN> feat<SPAN class="punctuation token">.</SPAN>geometry
<SPAN class="keyword token">var</SPAN> geometryService <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">GeometryService</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token"><SPAN>"</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FUtilities%2FGeometry%2FGeometryServer" target="_blank">https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer</A><SPAN>"</SPAN></SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">//geometryService.on("areas-and-lengths-complete", outputAreaAndLength);</SPAN>
<SPAN class="keyword token">var</SPAN> areasAndLengthParams <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN