<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi, I am working on a feature layer that have setDefinitionExpression i.e filters data shown based on ID. Now i want to pre-populate attribute ID=xxx when a new object point is added. How do i do that in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hi-i-am-working-on-a-feature-layer-that-have/m-p/559497#M52195</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;var responsePoints = new FeatureLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmyorgxxx%2Farcgis%2Frest%2Fservices%2FSecure%2FFeatureLayerName%2FFeatureServer%2F0" rel="nofollow" target="_blank"&gt;http://myorgxxx/arcgis/rest/services/Secure/FeatureLayerName/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;", {&lt;/SPAN&gt;&lt;BR /&gt; mode: FeatureLayer.MODE_ONDEMAND,&lt;BR /&gt; outFields: ['*']&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//apply sql filter&lt;BR /&gt; var id= &amp;lt;%=GetID()%&amp;gt;; &amp;nbsp;//this comes from Asp.net server side&lt;BR /&gt; responsePoints.setDefinitionExpression("ID="+&lt;SPAN&gt;id&lt;/SPAN&gt;);&lt;BR /&gt; map.addLayers([responsePoints]);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Nov 2016 17:21:57 GMT</pubDate>
    <dc:creator>satbirsingh</dc:creator>
    <dc:date>2016-11-25T17:21:57Z</dc:date>
    <item>
      <title>Hi, I am working on a feature layer that have setDefinitionExpression i.e filters data shown based on ID. Now i want to pre-populate attribute ID=xxx when a new object point is added. How do i do that</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hi-i-am-working-on-a-feature-layer-that-have/m-p/559497#M52195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;var responsePoints = new FeatureLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmyorgxxx%2Farcgis%2Frest%2Fservices%2FSecure%2FFeatureLayerName%2FFeatureServer%2F0" rel="nofollow" target="_blank"&gt;http://myorgxxx/arcgis/rest/services/Secure/FeatureLayerName/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;", {&lt;/SPAN&gt;&lt;BR /&gt; mode: FeatureLayer.MODE_ONDEMAND,&lt;BR /&gt; outFields: ['*']&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//apply sql filter&lt;BR /&gt; var id= &amp;lt;%=GetID()%&amp;gt;; &amp;nbsp;//this comes from Asp.net server side&lt;BR /&gt; responsePoints.setDefinitionExpression("ID="+&lt;SPAN&gt;id&lt;/SPAN&gt;);&lt;BR /&gt; map.addLayers([responsePoints]);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Nov 2016 17:21:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hi-i-am-working-on-a-feature-layer-that-have/m-p/559497#M52195</guid>
      <dc:creator>satbirsingh</dc:creator>
      <dc:date>2016-11-25T17:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Hi, I am working on a feature layer that have setDefinitionExpression i.e filters data shown based on ID. Now i want to pre-populate attribute ID=xxx when a new object point is added. How do i do that</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hi-i-am-working-on-a-feature-layer-that-have/m-p/559498#M52196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found answer to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first add&amp;nbsp; event to populate ID, when editing begins&lt;/P&gt;&lt;P&gt;dojo.connect(myFeatureLayer,"onEditsComplete",populateID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//then add function&lt;/P&gt;&lt;P&gt;function &lt;SPAN&gt;populateID&lt;/SPAN&gt;(addResults) { &lt;BR /&gt; if (addResults.length &amp;gt; 0) { &lt;BR /&gt; // this gets the corresponding graphic of the feature that was just added &lt;BR /&gt; var graphic = &lt;SPAN&gt;myFeatureLayer&lt;/SPAN&gt;.graphics[OccurrencesFL.graphics.length - 1]; &lt;BR /&gt; var ID = 123 ; (your id value here)&amp;nbsp;&lt;BR /&gt; graphic.attributes["ID"] =parseInt(ID); &lt;BR /&gt;&lt;SPAN&gt;myFeatureLayer&lt;/SPAN&gt;.applyEdits(null, [graphic], null);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Nov 2016 21:53:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hi-i-am-working-on-a-feature-layer-that-have/m-p/559498#M52196</guid>
      <dc:creator>satbirsingh</dc:creator>
      <dc:date>2016-11-25T21:53:40Z</dc:date>
    </item>
  </channel>
</rss>

