Attribute Assistant Field Trigger

1139
4
Jump to solution
10-10-2017 12:14 PM
Labels (1)
JoeBorgione
MVP Emeritus

The description of the field trigger states: "Updates a field to a specified value when the value of another field is updated"  I'd like to update a date field when another field is updated.  Is it possible to use a method (TIMESTAMP) as the specified value?

mmiller-esristaff

That should just about do it....
0 Kudos
1 Solution

Accepted Solutions
MikeMillerGIS
Esri Frequent Contributor

Unfortunately, no

View solution in original post

0 Kudos
4 Replies
MikeMillerGIS
Esri Frequent Contributor

Unfortunately, no

0 Kudos
JoeBorgione
MVP Emeritus

Rats....

That should just about do it....
0 Kudos
deleted-user-pZlUMHhkW23Q
New Contributor III

You actually can do it but it's abit of a hack to get it to work.

  1. Create a Field_Trigger on a feature to monitor a field, with a placeholder value in the ValueInfo section, something that is very unlikely to appear natively in your data like "11/11/1111". Give the Rule weight a value.
    1. Note: Dates like "1/1/1111" can cause problems cross systems due to differences in how the system time is set up so stick with 10+ for days and months.
  2. Create an Expression on the same feature on the same field and make an If statement to look for the placeholder value "11/11/1111" then do what you like with the value, if you want the date use the vbExpression: "Date" to pull the current date. Make sure the rule weight is set to NULL, since rules with a weight of Null are always run last. 

Here's an example of the code:

OBJECTID *Table NameFIELDNAMEValue MethodValue InfoOn CreateOn changeOn Change (Geometry)Manual OnlyRule WeightComments
7896UndergroundStructureAreaCONSTRUCTIONSTATUSFIELD_TRIGGER15|STATUSCHANGEDATE|11/11/1111FALSETRUEFALSEFALSE63
7893UndergroundStructureAreaSTATUSCHANGEDATEEXPRESSIONIIF([STATUSCHANGEDATE]="11/11/1111" AND [CONSTRUCTIONSTATUS], Date, Null)FALSETRUEFALSEFALSE<Null>
JoeBorgione
MVP Emeritus

Thanks Tristan- hack is my middle name...

tristanforward

That should just about do it....