Select to view content in your preferred language

Be able to use GlobalID during insert for related records on Calculate Rule.

438
2
09-28-2022 08:11 AM
BrettCummings1
New Contributor

I have a situation were I need to create/clone a feature and related records as well in a calculate rule.  The issue is the related records are related by the feature GlobalID. I have no issues if I use fields that are not read-only, but in my situation I do not have that luxury. I have tried:

  1. Setting the GlobalID prior to the insert using GUID() on the feature and using the same guid in the related record.
    1. Adding "GlobalID": "{E812C101-3D95-46A9-B12F-C45F3FBFA7F9}" to the attribute rules.
    2. Since it's a read only field, an error is thrown.
  2. Adding globalID one level after the 'adds' is ignored - { "edit": [ {"adds": [ { "attributes": ..., "geometry": ..., "globalID": "{AA12C101-3D95-46A9-B12F-C45F3FBFA7F9}" ]}]}
  3. Tried using the 'tag' flag, but that only works with UN Associations.
    1. https://pro.arcgis.com/en/pro-app/2.9/help/data/geodatabases/overview/attribute-rule-dictionary-keyw... 
    2. This is exactly what I want except to be able to indicate the related table.

Sample json trying to use the 'tag' keyword:

{
"edit": [
{
"adds": [
{
"attributes": {
"ASSETGROUP": 1,
"ASSETID": "ABC1234",
"ASSETTYPE": 9,
"LASTUPDATE": "2000-01-01T00:00:00.000Z"
},
"geometry": {
"hasZ": true,
"paths": [
[
[ 1035213.7623968, 2253188.4937827, 0 ],
[ 1035239.3082778, 2253154.9229833, 0 ]
]
],
"spatialReference": {
"wkid": 102671
}
},
"tag": "newLineFeature"
}
],
"className": "PipelineLine"
},
{
"adds": [
{
"attributes": {
"LineGlobalID": "newLineFeature.globalid",
"Notes": "A relate"
},
"tag": "newLineFeatureRel0"
}
],
"className": "LineRelateTable"
}
],
"result": "Completed"
}

Is there any way to do this?

Thanks

0 Kudos
2 Replies
MikeMillerGIS
Esri Frequent Contributor

The new feature needs a global ID that will be related to the cloned related record, as this is calcuated on the server, you need to use the tags. 

Check out this topic and looks for this line in the code sample

"tag": "jo1", //unique identifier for new feature in the Structure Junction Object class

https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/attribute-rule-dictionary-k...

0 Kudos
BrettCummings1
New Contributor

Thanks for the response. I have tried that, the issue with that is it's limited to "utility network associations table" and doesn't work for 'Relate'. If they extended that 'tag' to work with Relates, that would resolve my problem.

0 Kudos