POST
|
Yes, you simply change the split model from update/insert to, delete insert insert
... View more
3 weeks ago
|
0
|
1
|
87
|
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
3 weeks ago
|
0
|
2
|
66
|
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
3 weeks ago
|
0
|
0
|
109
|
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
|
86
|
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
|
142
|
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
|
167
|
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
|
171
|
POST
|
Yeah your rule will trigger forever, just like in recursion you will need a base condition for your attribute rule. And that is if pushvalue is the same, just no-op. // 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 }
var u = {
globalID: f.GlobalID,
attributes: {
Pushvalue: $feature.Pushvalue
}
}
Push(updates, u)
}
return {
result: {
attributes: {
Pushvalue: $feature.Pushvalue}
},
edit: [{
className: "Sirenen",
updates: updates
}]
} also for additional optimization (although you might have done on purpose for Editor tracking), add a filter to your sql to only push the different var pushValue = $feature.pushvalue
var SQL = "GemeindeID = @GID AND GlobalID <> @GLID AND pushvalue <> @pushValue"
... View more
03-07-2024
08:16 AM
|
0
|
6
|
203
|
BLOG
|
Thanks @Bud I used file just to support older Pro releases, That being said, I just tried to upload a row mobilegdb but got an error (content type octet stream doesn't match file extension .geodatabase), the change might take time to fully propagate
... View more
02-27-2024
09:15 AM
|
1
|
0
|
203
|
POST
|
There isn't an out of the box way to do it but you can script it with an options table as I show here https://community.esri.com/t5/attribute-rules-blog/how-to-toggle-constraint-and-calculation-attribute/ba-p/1387438
... View more
02-27-2024
07:38 AM
|
1
|
0
|
165
|
IDEA
|
There isn't an out of the box way to do it but you can script it with an options table as I show here https://community.esri.com/t5/attribute-rules-blog/how-to-toggle-constraint-and-calculation-attribute/ba-p/1387438
... View more
02-27-2024
07:35 AM
|
0
|
0
|
172
|
BLOG
|
We hear this requirement very often from customers in geonet and the conferences; Is there a way to temporarily disable all immediate attribute rules? While out of the box there isn't a way to do that as it requires changing the schema (physically disabling each rule and stopping any services), I thought I'd share a workaround for users who really want to implement this in their system. By adding an "options" table with a column EnableAR, we can have each rule before it executes checks this table and reads the value at runtime. If the value is 0 the rule immediately returns, if the value is 1 the rule logic executes as normal. I made an example here (attached) and a video to demonstrate With this approach you can quickly toggle all attribute rules execution and you can even control what type rules you want to enable and disable. The downside of this is you have to update all your rules to start using this check, but once you do you are good to go. The other thing to watch out for is in multi-user environment one user can toggle this option to disable the rule and post it to DEFAULT effectively disabling the rules for all users which is something you might not want. You can of course add additional checks to prevent this logic in DEFAULT using the gdbVersion function. Filegdb with code attached
... View more
02-27-2024
07:34 AM
|
2
|
3
|
353
|
POST
|
Thanks I can reproduce it looks like a bug when the association is being added in multiple payloads, we will take a look. Meanwhile the workaround is to group all associations in one payload. return {
"edit": [
{
"className" : "ElectricDistributionJunctionObject",
"adds" : [{
"tag": "unit1",
"attributes": {
"assetgroup": 2,
"assetType": 1}
}]},
{
"className": "^UN_Association",
"adds": [{
"fromClass": "ElectricDistributionJunctionObject",
"fromGlobalId": $feature.GLOBALID,
"toClass": "ElectricDistributionJunctionObject",
"toGlobalId": "unit1.globalID",
"associationType": "containment"
},
{
"fromClass": "ElectricDistributionJunctionObject",
"fromGlobalId": $feature.GLOBALID,
"toClass": "ElectricDistributionJunctionObject",
"toGlobalId": "unit1.globalID",
"fromTerminal": "Source",
"associationType": "connectivity"
},
{
"fromClass": "ElectricDistributionJunctionObject",
"fromGlobalId": $feature.GLOBALID,
"toClass": "ElectricDistributionJunctionObject",
"toGlobalId": "unit1.globalID",
"fromTerminal": "Load",
"associationType": "connectivity"
}
]},
]
}
... View more
02-19-2024
10:25 AM
|
0
|
1
|
189
|
POST
|
No known issues in 3.2, all scripts should just work. Looking at the code I see you are using a variable LBCode where it is not defined, this might be a bug in 3.1 that we fixed in 3.2 (we start detecting undefined variables), you might have meant to use attributeValue instead. thanks I would suggest for performance avoiding using the count here and just do first and check for null and only ask for you are using. here is the rewritten script with the LBCode fixed. var intersectLayer = FeatureSetByName($datastore, "Lsgd_Boundary", ['LBCode'], false);
var attributeName = 'LBCode';
var intersectingFeatures = Intersects(intersectLayer, $feature);
var intersectedFeature = First(intersectingFeatures);
if (intersectedFeature == null) return 'NA';
var attributeValue = intersectedFeature[attributeName];
// Generate a unique sequence number
var id = NextSequenceValue("uniqueid");
// Concatenate LBCode and the unique sequence number
var projectID = attributeValue + "-" + id;
return projectID;
... View more
12-27-2023
08:38 AM
|
1
|
2
|
449
|
Title | Kudos | Posted |
---|---|---|
1 | 08-08-2022 10:29 AM | |
1 | 03-11-2024 01:09 PM | |
1 | 03-08-2024 10:51 AM | |
1 | 03-08-2024 10:16 AM | |
1 | 02-27-2024 09:15 AM |
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|