Editor tracking - read configuration

3331
4
09-26-2013 12:33 AM
DariusBuinovskij2
New Contributor
Hi,

I'm using Editor tracking. When I'm creating new table I setup it like that:
IClassSchemaEdit4 schemaEdit = ......
schemaEdit.IsTimeInUTC = true;
schemaEdit.EditedAtFieldName = "MODIFICATIONDATE";

The problem is that I need to read those settings somehow. I unable to find how to access that info when I have ITable interface (cast to what?).
I found IEditorTrackingInfo interface. But I unable to find how I can access it from ITable. I found that IDataObjectTable2 has EditorTrackingInfo property, but here again, I need to go from ITable to IDataObjectTable2 somehow.
Also such info exits in IDEEditorTracking interface, but it's for geoprocessing.

Strange that it's not possible to access those properties in easy way - usually new things are available when you cast to some new interface, but it seems no this time. Any help?
0 Kudos
4 Replies
WilliamBuerger
New Contributor III

Just wanted to add that I was looking for this same info.  I want to report out what features classes have edit tracking set and with what values.  It would appear that there is no way to get at this information.  Or at least not a documented way in ArcObjects.  The IDataObjectTable2 interface appears to be coming from ArcServer and sounds like it may have been dropped as of 10.1.  And as mentioned IDEEditorTracking is for geoprocessing.  Why is this not available?  We're given a method to set these values but not read them.  Ug.

0 Kudos
AndryJoos
New Contributor III

Have you ever found a solution for this? We're currently facing a similar problem.

0 Kudos
WilliamBuerger
New Contributor III

Actually, yes I did.  Unfortunately, it does require using the geoprocessor since ArcObjects still doesn't have a way to read this information.  But using the Geoprocessor and the IDEEditorTracking interface will give you the current edit tracking configuration information.  Here's a snippet that should give you the info on a specific feature class.

Debug.Print("Name, Enabled, CreatedAtFieldName, CreatorFieldName, EditedAtFieldName, EditorFieldName");

string ClassPath = @"D:\Data\Test.gdb\FeatClass";

object DataType = "";

IDataElement DataElement = GP.GetDataElement(ClassPath, ref DataType);

IDEEditorTracking DeEditTrack = (IDEEditorTracking)DataElement;

if (DeEditTrack.EditorTrackingEnabled)

{

   Debug.Print("{0}, true, {1}, {2}, {3}, {4}", ClassPath, DeEditTrack.CreatedAtFieldName, DeEditTrack.CreatorFieldName, DeEditTrack.EditedAtFieldName, DeEditTrack.EditorFieldName);

}

else

{

   Debug.Print("{0}, false", ClassPath);

}

AndryJoos
New Contributor III

Hi William! Thank you for your answer and the snippet! This might work for our case too, and I will try it right away.

0 Kudos