Select to view content in your preferred language

Attribute Rules won't execute on SDE feature dataset

401
2
Jump to solution
10-03-2024 07:41 AM
Peter_Green
Occasional Contributor

Good afternoon

My organisation has created a new enterprise geodatabase in SQL Server. We have created a data owner user for the new EGDB that was used to load various feature classes into the new database. During the data loading, several attribute rules were created on the new feature classes. These seem to execute as expected.

I have subsequently created a new data editor user on the EGDB that has all the required permissions to SELECT, INSERT, UPDATE, DELETE.  

This new user generally seems to behave as expected. I am able to read/load the different feature datasets. However, when I try to create a new feature in any of the datasets that have an attribute rule applied I get an error message ("Failed to evaluate Arcade expression. [Rule name: Calculate Unique ID, Triggering event: Insert..."). I am not able to add any new features, although interestingly I am able to edit existing features within the feature classes with attribute rules.

Checking the attribute rule window, it gives a message that says "The table or feature class corresponding to this view is read-only". This doesn't seem correct as I am able to modify the feature class, I just can't add new features.

Furthermore within the new data editor user I am unable to add/edit/delete attribute rules. However, if I use the data loader user to remove the attribute rules, I am then able to create new features using the data editor rule.

In short it seems that only the data owner is able to create and execute attribute rules on feature classes. Other users with sufficient privileges are unable to create features within the feature classes if there is an attribute rule in place. The data editor is also unable to execute/edit/delete existing attribute rules. 

Just wondering if this is expected behaviour? Is it possible to for attribute rules to be created and executed by a user other than the data owner.

Thanks for your consideration.

0 Kudos
1 Solution

Accepted Solutions
Peter_Green
Occasional Contributor

So, in the end this wasn't an issue with the attribute rules, but with a database sequence I had created that the attribute rule was using as a counter. As far as I understand the database sequence sits as an object in the database, just like any table and needs the correct permissions to execute using a non-data owner user.

The simple solution was to include the name of the database sequence owner as part of the call to the database sequence in the attribute rule. The attribute rule ended up looking like this: 

var id = NextSequenceValue("sequence_owner.sequence_name")
return id

View solution in original post

0 Kudos
2 Replies
ChrisStiwinter1
Occasional Contributor

Some of this is correct.. only the data owner should be able to create, update and delete attribute rules. 

How is your database versioned?  Sort of sounds like the data is not versioned..??   IF its versioned then of course your editor will need to edit a version vs. default version (which would also give error of 'this table is read only').

By the wording of the insert error on calculateID attribute rule : that sounds like attribute rule error in logic.

could also be a database permission issue..

Peter_Green
Occasional Contributor

So, in the end this wasn't an issue with the attribute rules, but with a database sequence I had created that the attribute rule was using as a counter. As far as I understand the database sequence sits as an object in the database, just like any table and needs the correct permissions to execute using a non-data owner user.

The simple solution was to include the name of the database sequence owner as part of the call to the database sequence in the attribute rule. The attribute rule ended up looking like this: 

var id = NextSequenceValue("sequence_owner.sequence_name")
return id

0 Kudos