AnsweredAssumed Answered

Attribute Rule - Edit another Feature Class with Archiving Enabled

Question asked by Michael.Brown31@jacobs.com_Jacobs on Feb 20, 2020



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





    return {

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

        'edit': [{

            'className': 'Address_pnts',

            'updates': AddList



} else {

    return 'No address points in district.'