|
POST
|
That is because attribute rules are triggered on updating any field. the target field you set on the attribute rule view is the field you want to set the value to, not the field you that you want triggering the rule. Updating any field will trigger the rule
... View more
05-02-2024
12:31 PM
|
0
|
2
|
1607
|
|
POST
|
Unfortunately in complex recursive case like this where the child updates the parent and the parent updates the child we need more context in the attribute rule itself. Currently it is not possible to differentiate between an edit made as a side effect of attribute rule vs an edit that is made directly by the user. Adding that field allows us hint us to know is this edit done by the user or is it a result of a propagation from parent which will allow us to continue propagation vs to stop. The field can be added but hidden so users don't see it. Without this knowledge, parent updates child, which triggers the rule to update the parent which then triggers the rule again to update the child.
... View more
05-02-2024
11:20 AM
|
0
|
4
|
1622
|
|
POST
|
Yeah there is a bug here, we are suppose to yell at you that you can't pass variables to FeatureSetByName, because we need the name to be static so we can resolve the table name to a registered geodatabase catalog id. Change your script wherever you have a featuresetbyname and pass in a literal string instead. for example FeatureSetByName($datastore, addresspoint_fc, ['*'], true), firstPoint); to , this and it should solve the problem FeatureSetByName($datastore, "AddressPoint", ['*'], true), firstPoint); Meanwhile we will fix the bug where it tells you the exact the error message instead of 9999 error. it shouldn't even let you save it to begin with.
... View more
05-02-2024
08:35 AM
|
1
|
1
|
1203
|
|
POST
|
I think I addressed a similar issue here https://community.esri.com/t5/attribute-rules-questions/error-quot-rules-is-cyclic-or-exceeds-maximum/m-p/1394354/highlight/true#M1345 there is an attached geodatabase with the example code. This is similar to what you are trying to do, still uses a foreign key (but no actual relationship class), they have a groupId in the feature, when a certain field gets updated they want all the features with same groupid to have the same value of that field. The video explains it The trick is to avoid calling or triggering the attribute rule when we don't need to, I think your code is almost there, just need to add an additional check before globalid check if(f.GlobalID == $feature.GlobalID) { continue } if(f.childfield== $feature.parentfield) continue;
... View more
05-02-2024
08:10 AM
|
0
|
6
|
1641
|
|
POST
|
Hey Cole, Can you share your pro version and the rule script you are working with? does this problem occur in the attribute rules view as well? Does it work with simple rules? like create a new rule with return 0; can you then update it to add a comment? want to see if this is data specific or something else.
... View more
05-01-2024
03:23 PM
|
0
|
3
|
1272
|
|
POST
|
To add to this thread, when using Console with attribute rules we write a debug entry in both server manager logs and ArcGIS Pro Monitor diagnostics. This helps tremendously in debugging. Here is a simple example This was first introduced in Pro 3.2/11.2 and the fix has been ported to the following patches - ArcGIS Pro 3.0.6 - ArcGIS Pro 3.1.3 - ArcGIS Pro 2.9.11 - ArcGIS Server 10.8.1 Utility Network and Data Management Patch 11 - ArcGIS Server 10.9.1 Utility Network and Data Management Patch 6 - ArcGIS Server 11.1 Utility Network and Data Management Patch 2
... View more
04-25-2024
09:20 AM
|
2
|
0
|
3537
|
|
POST
|
Hey James, we will have to fix that page in the doc, the Validation rules and batch calculation rules execute on demand via the evaluate call and not on user edits. So $originalFeature isn't applicable. If you think about it the edit has already been made, running evaluate we have no idea what happened to the feature
... View more
04-24-2024
03:41 PM
|
0
|
1
|
1073
|
|
POST
|
Yes, you simply change the split model from update/insert to, delete insert insert
... View more
04-02-2024
02:12 PM
|
0
|
1
|
1784
|
|
POST
|
This should not be possible , as NextSequenceValue simply queries the database for the next sequence (using .nextval) and databases often handle that really well. It could be that the app is overwriting the value somehow via an update. Check the creation user/last updated for the duplicate unique id which one is newer is probably the duplicate, also to be safe make the field uneditable. If you are using branch versioning or archiving you can use the history to investigate how the unique id happened to be. Do you know what is the database?
... View more
04-01-2024
04:15 PM
|
0
|
2
|
856
|
|
POST
|
Edit: I went back to 2.9.11/ 3.1/3.2 and I'm getting the correct behavior (split only generates one sequence) Make sure when you test, create a new line feature, then do the split. this will generates a new sequence number for the line, but then the split will use the next value. If you discard the edits the sequence is not returned (will be burned)
... View more
04-01-2024
09:11 AM
|
0
|
1
|
1221
|
|
POST
|
Can we try the following? When running python on a class with attribute rules you must specify all the fields required by the attribute rule in the python cursor. Here is an example I have a table with three fields a,b, and c. Field c has an attribute rule return $feature.b * 2. So the rule require fields b and c Because b and c are required by the attribute rules those fields must by passed to python as follows. def update_standalone(fields):
with arcpy.da.UpdateCursor(str(gdb / 'standalone'), fields) as cursor:
for row in cursor:
row[0] += 1
cursor.updateRow(row)
print('Running')
update_standalone(['a', 'b', 'c']) # Succeeds
# passing only a will fail
# update_standalone(['a']) # RuntimeError: Failed to evaluate Arcade expression.
# passing only b will also fail
# update_standalone(['b']) # SystemError: <method 'updateRow' of 'da.UpdateCursor' objects> returned NULL without setting an error
# passing all fileds or the required fields for attribute rules will succeed
# update_standalone(['a', 'b', 'c']) # Succeeds
# update_standalone(['b', 'c']) # Succeeds
print('Done')
... View more
03-19-2024
09:58 AM
|
0
|
0
|
1475
|
|
POST
|
I think this might be a refresh issue in the table view, closing and reopening the table should refresh it (i'll make sure to log a bug to fix that) , but if you edit the map directly you can see the value changes instantly, I had this project with labeling and symbology on.. but here is a video along side the data.. works as expected
... View more
03-11-2024
01:09 PM
|
1
|
1
|
1720
|
|
POST
|
This one is really interesting, just found another issue when you have more than 6 features to update, because we have a limit of the number of Arcade engines the script hit that limit pretty soon. The only workaround to really fix this is to have an additional field, I added a field called isPush with a integer value. We want to essentially differentiate between a user update changing the pushvalue vs an automated attribute rule update. You can hide the ispush field from users as it will only be used by the attribute rule. if ($feature.ispush == 1) return {"result": {"attributes": {"ispush": 0}}}; Final script.. // calculed Field $feature.Helper
// Triggers: Insert, Update
// Exclude from application evaluation
//add base condition
if ($feature.ispush == 1) return {"result": {"attributes": {"ispush": 0}}};
if($originalFeature.pushvalue == $feature.pushvalue) return;
var GID = $feature.GemeindeID
var GLID = $feature.GlobalID
// filter current featureset except the feature that is edited rn
var SQL = "GemeindeID = @GID AND GlobalID <> @GLID"
var sirenen = FeatureSetByName($datastore, "Sirenen", ["*"])
var filterSirene = filter($featureset, SQL)
console(count(filterSirene))
var updates = []
for(var f in filterSirene) {
if(f.GlobalID == $feature.GlobalID) continue;
//don't update values that are the same to avoid recursion.
if(f.pushvalue == $feature.pushvalue) continue;
var u = {
globalID: f.GlobalID,
attributes: {
Pushvalue: $feature.Pushvalue,
ispush :1
}
}
Push(updates, u)
}
return {
result: {
attributes: {
Pushvalue: $feature.Pushvalue}
},
edit: [{
className: "Sirenen",
updates: updates
}]
}
... View more
03-08-2024
10:51 AM
|
1
|
3
|
1745
|
|
POST
|
Ok I forgot to deal with one more thing which is when the value is the same don't even attempt the update. Tested this one locally and it worked. // calculed Field $feature.Helper
// Triggers: Insert, Update
// Exclude from application evaluation
//add base condition
if($originalFeature.pushvalue == $feature.pushvalue) return;
var GID = $feature.GemeindeID
var GLID = $feature.GlobalID
// filter current featureset except the feature that is edited rn
var SQL = "GemeindeID = @GID AND GlobalID <> @GLID"
var sirenen = FeatureSetByName($datastore, "Sirenen", ["*"])
var filterSirene = filter($featureset, SQL)
console(count(filterSirene))
var updates = []
for(var f in filterSirene) {
if(f.GlobalID == $feature.GlobalID) continue;
//don't update values that are the same to avoid recursion.
if(f.pushvalue == $feature.pushvalue) continue;
var u = {
globalID: f.GlobalID,
attributes: {
Pushvalue: $feature.Pushvalue
}
}
Push(updates, u)
}
return {
result: {
attributes: {
Pushvalue: $feature.Pushvalue}
},
edit: [{
className: "Sirenen",
updates: updates
}]
}
... View more
03-08-2024
10:16 AM
|
1
|
4
|
1749
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-03-2025 12:32 PM | |
| 1 | 01-02-2025 06:31 AM | |
| 4 | 09-03-2025 12:49 PM | |
| 1 | 08-27-2025 10:23 AM | |
| 2 | 08-12-2025 11:01 AM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|