Hi
i have a probleme in my attribute rule that is executed twice in my feature service
the code calculate an id that increment by +1
// get the feature with the highest id
var m = FeatureSetByName($datastore,'oncf.dgf.urb_projet', ['*']);
var s= filter(m, "code_urb like 'URB%'")
var max_feature = First(OrderBy(s, "code_urb DESC"))
// get the number of that id
var max_number = 0
if(max_feature != null) { // no features in featureset? -> this block is skipped and max_number is 0
var txt = Replace(max_feature.code_urb, "URB", "")
max_number = Number(txt)
}
// calculate and return the new id
return "URB" + Text(max_number + 1, "00000")
when i create record in arcgis pro through geodatabase evrything work perfectly, for each record i create the ID increment by +1, but when i edit the data through feature service in Arcgis Pro or with the Edit widget in web app builder its like the attribute rule is executing twice (URB00002, URB00004, URB00006....) +2 for each new record.

thanks for you help