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:
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:
Thanks,
Amanda Huber
Hello, did you ever figure this out? We are having the same issue.
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.