Attribute Rule - Edit another Feature Class with Archiving Enabled

279
0
02-20-2020 01:47 PM
MichaelBrown4
New Contributor III

Hello,

I am following the code below from Attribute rule script expression examples—Geodatabases | Documentation almost identically (feature classes and field names differ obviously) and getting errors when executed in the browser/web app.  The error is telling me I can't perform the edits outside an edit session (see screenshot of error).  When executed within ArcPro the attribute rule is successful.  Could this have to do with having Archiving enabled on the feature class being edited/updated?

var fsAddress = FeatureSetByName($datastore, "Address_pnts", ["globalid"], true)

var fsListAddpnts = Intersects(fsAddress, $feature)

var AddList = []

var counter = 0

var noAddress = Count(fsListAddpnts)

if (noAddress > 0) {

    for (var address in fsListAddpnts) {

        AddList[counter] = {

            'globalid': address.globalid,

            'attributes': {

                'add_district_name': $feature.DistrictName

            }

        }

        counter++

    }

    return {

        'result': noAddress + ' addresses found in the district.',

        'edit': [{

            'className': 'Address_pnts',

            'updates': AddList

        }]

    }

} else {

    return 'No address points in district.'

}

Tags (1)
0 Replies