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:
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?
Could you post the entire arcade script?
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.
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
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".
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?