Attribute Rule Fails to run When Editing from a Feature Service

1898
5
10-16-2020 05:26 PM
JimWilliams
New Contributor III

Hello,

I am using a simple attribute rule to create a polygon in our database when a new record is inserted. When I create e new record in ArcGIS Pro the attribute runs fine, but when I use a feature service that I have published and try to create a new record I get a error:

The ArcGIS AddFeatures call failed with code 1017 and description 'Failed to evaluate Arcade expression. [ Rule name: Create_dummy_Polygon, Triggering event: Insert, Class name: DevTracker_TentativeMap, GlobalID: {D3D3B619-C823-4494-9C77-1E22EE44C436}]'.

Acrdae Statement:

var polygonJSON = {"rings":[[[-120.06134033203125,39.07570985562645],[-119.981689453125,39.07570985562645],[-119.981689453125,39.137516828427074],[-120.06134033203125,39.137516828427074],[-120.06134033203125,39.07570985562645]]], "spatialReference": { "wkid":3423}}
polygon(polygonJSON)

Has anyone had a attribute rule execute while editing from a Feature Service?

0 Kudos
5 Replies
MikeMillerGIS
Esri Frequent Contributor

Could you post the entire arcade script?

0 Kudos
JimWilliams
New Contributor III

Hello Michael,

Thanks for getting beck to me. That is the entire arcade script. It just creates a polygon for records when I create a record. So its not so much a arcade script issue as it is that when using a feature service the attribute rule sends back a error. 

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

If you try it in playground, you get an geometry engine issue.

https://developers.arcgis.com/arcade/playground/

Have you tried checking the box Exclude from Client so it is not trying to fire it in the browser? If you are trying to use a return edits statement, you will have to check this box anyways

JimWilliams
New Contributor III

Thank you for the reply, the error from the playground is because the wkid I have it for is state plane, which the playground doesn't use. So i checked the "Exclude from Client", and it still didn't work, thoroughly perplexed.  Thank you for the reply its good to know about the "Exclude from Client". 

0 Kudos
SergueiSokolov
New Contributor III

I have similar issue while creating features in Utility Network Comm v1 feature service (ArcGIS Pro 2.6.4, ArcGIS Enterprise 10.8.1). As part of troubleshooting, I have also published the Comm v1 Asset Package to a file geodatabase. In the Comm File geodatabase, I can digitize 2 wire knockouts and a wire duct bank StructureLine between them - no errors in Arcad attribute rules are displayed.

I applied the Comm asset package to the enterprise geodatabase and published a feature service. I made sure that all Attribute Rules have the "Exclude from Client evaluation" check box checked (even those that are disabled).  When I tried to repeat these same above steps in a branch version using Comm Feature Service, Pro shows a similar error : "Unable to complete operation. Failed to evaluate Arcade expression. [ Rule name: StructureLine - Create Duct in Duct Bank, triggering event: Insert, Class Name: StructureLine..." (see attached).

I compared the attribute rule between the File geodatabase and the Feature service, the only difference in details of the data source (i.e. local vs enterprise geodatabase). In summary, the Attribute Rule works with the Local file geodatabase works, and does not work when editing in the feature service. I had no issues / errors reported when Applying the asset package and publishing feature services.

Is there a way to troubleshoot such an error in Attribute Rule when using a Feature Services? Are there any recommendations?