Sunday 28 June 2015

Can ArcGIS for Desktop auto populate Date Field with current date/time when feature is created?


I am using Arc Desktop 10.3.1 in a versioned environment. In the geodatabase for the service requests there is a field called Date Notified. I would like this field to be auto-populated with the current date\time when a new feature is created. ( See attached picture) I have tried setting the field to Now() (Now) (Current_Timestamp) and others and each time it tells me my syntax is incorrect. Is this possible to do and if so what is the correct syntax to accomplish this.


Also I am aware of attribute assistant but I do not want to use that.


enter image description here



Answer



I don't think there is a way to do that for a particular date field, and this link provided by Get Spatial confirms it. However, if you turn on Editor Tracking, it will create fields for:



  • Creation Date

  • Creator

  • Last Edit Date


  • Last Editor


You have the option to name these fields to whatever you want. So, you could call the Created Date Field "Date Notified" if you like.


Note, Editor Tracking is turned on at a feature class level. So you'll need to turn it on for every feature class you have. This should be a trivial exercise with a python for loop.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...