ArcFM Desktop Developer Guide
Attribute Autoupdaters

Resource Center Home

The attribute AU is a quick way to add event-based attribute updates for field data. The first requirement is to decide to which field the AU should be assigned. ArcCatalog tools can be used to select the database table containing the desired field. Right click the table and select "Properties" from the context menu to display the list of fields (on the Fields tab). Click the field name desired and note the "Data Type" (second column) and the "Domain" (lower Field Properties grid) values. These two values will be needed to define the FieldType and DomainName properties, respectively, for the AU.


Interfaces:
     IMMAttrAUStrategy

Component Category:
    AttrAutoUpdateStrategy

Exiting Without Changes

When an attribute AU fires, MMAutoUpdater expects a value. MMAutoUpdater uses this value to change the value of the field. You may use an attribute AU to check specific criteria and, if the criteria aren’t met, exit the autoupdater without modifying the field. To do this, raise the MM_S_NOCHANGE error. This technique tells MMAutoUpdater to ignore the attribute AU and processing continues without changing the field. The sample code below demonstrates: 

  

C# Snippet
Copy Code
object autoValue = null;
Type type = Type.GetTypeFromProgID("mmGeodatabase.MMAutoUpdater");
object obj = Activator.CreateInstance(type);
IMMAutoUpdater autoupdater = obj as IMMAutoUpdater;
if(autoUpdater.AutoUpdaterMode == mmAutoUpdaterMode.mmAUMFeederManager)
{
throw new COMException("No Change Made", (int)mmErrorCodes.MM_S_NOCHANGE);
}
else
{
autoValue = Environment.UserName;
}
return autoValue;

The example above shows a case in which the attribute autoupdater exits if ArcFM’s Feeder Manager is responsible for the edit that caused the attribute autoupdater to be executed. So if Feeder Manager is running, the attribute autoupdater will not change the value.

 

 

 


Send Comment to ArcFMdocumentation@schneider-electric.com