Select to view content in your preferred language

ArcGIS Pro- Attribute Rules in a *SDE Referenced* Enterprise Portal GIS Service?

510
2
05-14-2024 01:29 PM
Amanda__Huber
MVP Regular Contributor

Hello, 

We recently created Attribute Rules in our enterpise SDE and published to our Enterprise Portal as a 'referenced service'. When editing in map viewer we see this error: 

Amanda__Huber_0-1715718462905.png

It's unclear in the documentation for Pro if Enterprise Portal services support Attribute Rules since the doc only mentions AGOL- https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/share-datasets-with-attribu...

 

Asking for a friend! This was supposed to be our workaround to Map Viwer's forms not allowing for editabiliy and field calculations simultaniously 



Additional notes regarding our setup: 

    • We are using a SQL database, enterprise SDE
    • Published with Pro 3.2.2
    • Enterprise Portal version 11.2
    • We are using “Immediate Calculation Rules” and here are the arcade expressions/configurations:
      Amanda__Huber_0-1715883895118.png

       

       Amanda__Huber_1-1715883895122.png

       

    • Something else to note- these attribute rules are created on a related table. Users will be adding new related records as part of the workflow, both parent table and related table are in the same ‘referenced’ service with “add” and “Update” editing enabled.

 

Thanks, 

Amanda Huber

2 Replies
TomJansen3
New Contributor

Hello, did you ever figure this out?  We are having the same issue.

0 Kudos
JoshuaDalton
Occasional Contributor

I was also getting the "Something went wrong Edits could not be saved: Unable to complete operation." error.

Install Telerik's FIDDLER and watch your browser's web traffic, you should see a failed request come through when you hit Create or Update.  Click on that and you'll see a way more useful error message.  It would be nice if they put the failed rule name in that generic error message.

You'll see something like this in the response content:

Internal error during object insert. Failed to evaluate Arcade expression. [
Rule name: IU_LastEditUserID,
Triggering event: Insert,
Class name: AREAS_POLYGONS,
GlobalID: {A12345EA-1F12-12E1-1B12-0123456789D1},
Arcade error: Unexpected null,
Script line: 2]

 

Also, debugging method aside, you can probably fix your error by changing the Arcade expression to use HasItem first, then make sure the value is not null too before using it.  Sometimes more like this function that gets the right user id from both ArcGIS Pro and Portal (because it may return a value or have certain attributes in one but not the other):

var username="";
var userinfo = GetUser();
if(userinfo==null)
{
username="";
}
else if(HasValue(userinfo, "email"))
{
var array = Split(userinfo.email,"@",1);
username = array[0];
}
else if(HasValue(userinfo, "username"))
{
username=userinfo.username;
}
return username;


In short, make sure you always check your arcade function call results to be sure they didn't return a null before using the attributes inside them.

0 Kudos