AnsweredAssumed Answered

Attribute rule problem with feature layer with attachment

Question asked by havlickova.jana on Jun 9, 2020
Latest reply on Jun 10, 2020 by xander_bakker

Hi there, 

I have an issue with very simple (as i hoped) attribute rule, which should calculate number to a new feature. The number should be just one higher than maximal value found in the attribute. Here is my arcade: 


if ($feature.created_date != $feature.last_edited_date&&$feature.last_edited_user!="GIS") return $feature.cislo
var stanoviska = FeatureSetByName($datastore,'gisdata_sde.gis.UUP_zavazna_stanoviska_p',['cislo'], true)
var max_cislo = Max(stanoviska, 'cislo')
return ++max_cislo 


Funny thing. Everything seems okay, when i draw new feature in ArcGIS Pro it calculates value for field "cislo" well (just one higher). But when I draw new feature in Web App (from WebAppBuilder) using both Edit or smart editor widget the value in field "cislo" counts +2. I found out that the rule works well when the feature class doesn't have attachments but I need to work with FC with attachments. Is there any solution for this issue? It's kind of driving me crazy. 


Data are stored in SDE geodatabase as polygon feature class with attachments enabled and is published as service to arcgis server 10.7.1 (federated with portal). And attribute cislo is type of short integer (i also tried long integer and text). 


Every help is appreciated.