Hi Johannes,
This is exactly the type of thing I need but unfortunately, I have not been able to get it to work yet. In ArcGIS Pro 2.8.2, with an on prem Portal at 10.9, and MS SQL Server 2019, I have a point feature class related to a table called Elec_FIXTURE with a primary and foreign key named Pole. I have added the following code as a calculation attribute rule.
// Calculation Attribute Rule
// Feature class, field FeatureKey (the field that relates the tables to the fc)
// Triggers: Insert
// Get the new feature's key value
var key = $feature.Pole
// If key is null, return early, don't create entries in the related tables
if(IsEmpty(key) || key == null) { return key }
return {
"result": key,
"edit": [
{
"className": "pTest6.GISPORTALADMIN.Elec_FIXTURE",
"adds": [
{"attributes": {"Pole": key}}
]
}
]
}
When I attempt to add a point I receive the following error:
Failed to create new feature(s).
The field type is not supported by arcade script. [
Rule name: AddFixtures,
Triggering event: Insert
Class name: pTest6.GISPORTALADMIN.LightPoles,
GlobalID: {<globalID>}
Error Number: 3
Error message: Something is wrong.]
I use a template to fill out Pole before the point is placed so the value of Pole is not null. Any insight or assistance you could offer would be appreciated.
Thank you in advance.