Hello!
I have a web form that calculates an incremental ID and then concatenates it to form a refNumber.
It works fine until you decide to update the point: let's say the position is incorrect and you need to move it.
this is the code and below are the results: the number should stay the same as it is the same point:
// Get the current feature's newID field value
var currentID = $feature.newID;
// Check if currentID is null or empty, meaning this feature needs a new ID
if (IsEmpty(currentID)) {
// Get the maximum value of the newID field from all features in layerName
var maxID = Max(FeatureSetByName($datastore, "layerName", ["newID"]), "newID");
return maxID + 1;
} else {
// If currentID is already set, return the existing currentID
return currentID;
}
create a point with ID 5 and then moved it becomes 6
Any idea?
Thanks!
Solved! Go to Solution.
Think you just need to check the $editcontext.editType. If "INSERT", calculate ID, if "UPDATE", just move point without calculating.
Basically the same as this post.
R_
Think you just need to check the $editcontext.editType. If "INSERT", calculate ID, if "UPDATE", just move point without calculating.
Basically the same as this post.
R_