Simple way to quickly pause all attribute rules

741
6
09-14-2023 09:29 AM
ScottLounsbury
New Contributor III

It would be great if there was a simple way (button) to pause all attribute rules so that field calculations or other processes can be done.  Right now doing any table calculation is extremely slow when there are attribute rules.  I have 24 attribute rules in my address point file and in order to pause them I have to stop each one individually which takes a lot of extra time.

6 Comments
SSWoodward

Thanks for the Idea @ScottLounsbury ,

This work is under consideration already for a future release!  I've updated the Idea status to reflect that. 

While this is being considered, I wanted to share a quick python example that will allow you to skip disabling rules one by one.  This example is a slightly modified version of an example in the disable attribute rules GP tool doc.

It is not as simple as a button, but it will allow you to use the python window to disable all your rules much faster.

 

import arcpy
fc = "C:\\MyProject\\MyDatabase.sde\\pro.USER1.Data"
desc = arcpy.Describe(fc).attributeRules
for rule in desc:
    if rule.isEnabled == True:
        print("Disabling rule: {}".format(rule.name))
        arcpy.DisableAttributeRules_management(fc, rule.name)

 

 

SSWoodward
Status changed to: Under Consideration
 
ScottLounsbury

Glad to hear that this is under consideration.  Thank you!

ChaimSchwartzIroads

Good to hear that this is under consideration. A simple functionality that would help here would be the ability to select multiple rules at once.

PeterHanna

@SSWoodward in an environment where there is multiple editors logged in, would the python script disable rules for them and then would you need to enable the edits for when you are finished?

ChelseaRozek

I would also like this functionality from Attribute Assistant to be brought over. A simple on/off button so you can do bulk calculations quickly and without potentially firing off unintentional update triggered rules.