Validate my theory? Attribute Rules and the Editable check box...

660
6
Jump to solution
08-24-2021 07:56 AM
Labels (1)
KimberlyMeinert
Occasional Contributor

I just recreated some of my attribute rules from ArcMap to ArcPro and I'm noticing some differences.  The one that's giving me the most heartburn right now is the "Editable" check box on the rule.

I have a few rules that grab attribute values from other underlying feature classes so when you place an address point or move it, it grabs the Municipality and the Parcel ID.  Works really well.  But sometimes we need to manually override this value, because reasons, and even though I have the "Editable" check box on, it doesn't let me overwrite a new value by hand, it just flips it back to the original value.

Is this because I have the "Update" check box on as well, so it thinks it has to run the rules again because I updated the record and you're caught in an impossible Catch-22?  Didn't we used to have an option to update only when the shape changed?  Because that's what I want to do.  I only want to update certain values when they get created or moved, but not just becuase some of the other attributes changed.  Is that possible somehow?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
JohannesLindner
MVP Regular Contributor

Yes, it's because of the Update trigger.

You can edit your values manually by putting something like this at the top of your rule:

 

// If there already is a value in $feature.Field, just return that value (essentially change nothing).
// That allows you to put some other values in there.
// If you want to reset the value to be automatically calculated, just delete it (set it to null), the update rule will trigger.

if(!IsEmpty($feature.Field)) {
  return $feature.Field
}

// your code goes here

 


Have a great day!
Johannes

View solution in original post

6 Replies
JoeBorgione
MVP Esteemed Contributor

I have similar rules with my site address points.  That's something I've wrestled with as well, firing rules upon editing the feature, regardless of how small an edit it is.  The best I've come up with is to disable the rule, make your edits and then re-enable the rule when you're done.

That should just about do it....
KimberlyMeinert
Occasional Contributor

This brings up another rub I have.  From what I can tell, the only way you can disable a rule is if you're connected as the database owner.  When people are editing, we're editing through a version, so the rules become read only since the database connection doesn't have schema permissions.  (Not to mention schema locks, etc, etc).  In ArcMap we used to be able to pause the rules for those tricky situations, and unless I'm missing something, I can't do it anymore.

JoeBorgione
MVP Esteemed Contributor

I didn't realize that as I'm the only guy who uses rules; at least for now, and I connect as the db owner. Sounds like that bun needs to go back in the oven for a while.

The ESRI address data managment solution provides a master street name table that is actually a domain.  If you deploy [any] domains in an enterprise gdb, only the domain owner can change them.  I've never used the master street name table for that reason.

That should just about do it....
0 Kudos
JohannesLindner
MVP Regular Contributor

Yes, it's because of the Update trigger.

You can edit your values manually by putting something like this at the top of your rule:

 

// If there already is a value in $feature.Field, just return that value (essentially change nothing).
// That allows you to put some other values in there.
// If you want to reset the value to be automatically calculated, just delete it (set it to null), the update rule will trigger.

if(!IsEmpty($feature.Field)) {
  return $feature.Field
}

// your code goes here

 


Have a great day!
Johannes
KimberlyMeinert
Occasional Contributor

That's an excellent tip, thank you!

0 Kudos
KimberlyMeinert
Occasional Contributor

I guess as a follow up though, we've chatted in the office and thought of situations where we're really going to be in a pickle and are going to have to get *real* creative to make it work similar to how the old attribute assistant used to work.  The Ideas page is going to get some entries...