Hi
I have attribute rule to update field based on other field value and values from tables,
its working ok when i edit the GrowthName field
but i try to edit the field the rules applied (Growth Code) when i apply the change the value change back to null
even if the GrowthName is null
and i cant figure out why
<SPAN class="keyword token">var</SPAN> Growth <SPAN class="operator token">=</SPAN> $feature<SPAN class="punctuation token">.</SPAN>GrowthName
<SPAN class="keyword token">var</SPAN> GrowthList <SPAN class="operator token">=</SPAN> <SPAN class="token function">FeatureSetByName</SPAN><SPAN class="punctuation token">(</SPAN>$datastore<SPAN class="punctuation token">,</SPAN><SPAN class="string token">"GrowthCodeTable"</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="string token">"Code"</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">"Name"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>Growth <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> sql <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Name = @Growth "</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> filterGrowth <SPAN class="operator token">=</SPAN> <SPAN class="token function">Filter</SPAN><SPAN class="punctuation token">(</SPAN>GrowthList<SPAN class="punctuation token">,</SPAN> sql<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">var</SPAN> GrowthCode <SPAN class="operator token">=</SPAN> <SPAN class="token function">First</SPAN><SPAN class="punctuation token">(</SPAN>filterGrowth<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>Code
<SPAN class="keyword token">return</SPAN> GrowthCode
<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>