ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data Namespace / AttributeRuleDefinition Class / GetTriggeringEvents Method
Example

In This Topic
    GetTriggeringEvents Method
    In This Topic
    Gets the editing events that will trigger the attribute rule to take effect. This parameter is valid for calculation and constraint rule types only. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetTriggeringEvents() As AttributeRuleTriggers
    public AttributeRuleTriggers GetTriggeringEvents()

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run
    A geodatabase-related exception has occurred.
    Example
    Get attribute rules of a dataset
    {
      // Must be called within QueuedTask.Run
      void GetAttributeRules(Geodatabase geodatabase, string tableName)
      {
        using (TableDefinition tableDefinition = geodatabase.GetDefinition<TableDefinition>(tableName))
        {
          // Get all attribute rule types
          IReadOnlyList<AttributeRuleDefinition> ruleDefinitions = tableDefinition.GetAttributeRules();
    
          // Iterate rule definitions
          foreach (AttributeRuleDefinition ruleDefinition in ruleDefinitions)
          {
            AttributeRuleType ruleType = ruleDefinition.GetAttributeRuleType();
            string ruleDescription = ruleDefinition.GetDescription();
            bool isAttributeFieldEditable = ruleDefinition.GetIsFieldEditable();
            string arcadeVersionToSupportRule = ruleDefinition.GetMinimumArcadeVersion();
            int ruleEvaluationOrder = ruleDefinition.GetEvaluationOrder();
            AttributeRuleTriggers triggeringEvents = ruleDefinition.GetTriggeringEvents();
            string scriptExpression = ruleDefinition.GetScriptExpression();
    
            // More properties ...
          }
        }
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.2 or higher.
    See Also