<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Why does IFieldChecker change the name of OID field? in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/why-does-ifieldchecker-change-the-name-of-oid/m-p/556644#M3747</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The&amp;nbsp;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/IFieldChecker_Interface/002500000340000000/"&gt;documentation for IFieldChecker&lt;/A&gt; states that the interface checks for errors in field names.&amp;nbsp; Specifically, it renames the OID field to "ObjectID" based on 4 cases.&amp;nbsp; When creating a standalone table in a geodatabase, using the IFieldsEdit interface to create the OID field, there are no requirements on what constitutes a valid name for the OID field.&amp;nbsp; However, if the OID field is not named "ObjectID" when fed to the FieldChecker, it is changed to "ObjectID".&amp;nbsp; What constitutes a valid OID field name?&amp;nbsp; Are there any restrictions on valid OID field names in a geodatabase?&amp;nbsp; Will naming my OID field something other than "ObjectID" cause issues?&amp;nbsp; See relevant code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFields fields = new FieldsClass();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFieldsEdit fieldsEdit = (IFieldsEdit)fields;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldsEdit.FieldCount_2 = 10;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IField field = new Field();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFieldEdit fieldEdit = (IFieldEdit)field;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldEdit.Name_2 = "MyOidFieldName";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldEdit.Type_2 = esriFieldType.esriFieldTypeOID;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldsEdit.set_Field(0, field);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Add other fields here...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // use IFieldChecker to create validated fields collection&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFieldChecker fieldChecker = new FieldChecker();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IEnumFieldError enumFieldError = null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFields validatedFields = null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldChecker.ValidateWorkspace = (IWorkspace)fws;&amp;nbsp; //fws = my feature workspace&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldChecker.Validate(fields, out enumFieldError, out validatedFields);&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;lt;--my OID field name is changed to "ObjectID"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcobjects 10.4.1‌objectid‌fieldname‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Apr 2019 21:04:21 GMT</pubDate>
    <dc:creator>WWalker</dc:creator>
    <dc:date>2019-04-26T21:04:21Z</dc:date>
    <item>
      <title>Why does IFieldChecker change the name of OID field?</title>
      <link>https://community.esri.com/t5/developers-questions/why-does-ifieldchecker-change-the-name-of-oid/m-p/556644#M3747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The&amp;nbsp;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/IFieldChecker_Interface/002500000340000000/"&gt;documentation for IFieldChecker&lt;/A&gt; states that the interface checks for errors in field names.&amp;nbsp; Specifically, it renames the OID field to "ObjectID" based on 4 cases.&amp;nbsp; When creating a standalone table in a geodatabase, using the IFieldsEdit interface to create the OID field, there are no requirements on what constitutes a valid name for the OID field.&amp;nbsp; However, if the OID field is not named "ObjectID" when fed to the FieldChecker, it is changed to "ObjectID".&amp;nbsp; What constitutes a valid OID field name?&amp;nbsp; Are there any restrictions on valid OID field names in a geodatabase?&amp;nbsp; Will naming my OID field something other than "ObjectID" cause issues?&amp;nbsp; See relevant code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFields fields = new FieldsClass();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFieldsEdit fieldsEdit = (IFieldsEdit)fields;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldsEdit.FieldCount_2 = 10;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IField field = new Field();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFieldEdit fieldEdit = (IFieldEdit)field;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldEdit.Name_2 = "MyOidFieldName";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldEdit.Type_2 = esriFieldType.esriFieldTypeOID;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldsEdit.set_Field(0, field);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Add other fields here...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // use IFieldChecker to create validated fields collection&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFieldChecker fieldChecker = new FieldChecker();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IEnumFieldError enumFieldError = null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFields validatedFields = null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldChecker.ValidateWorkspace = (IWorkspace)fws;&amp;nbsp; //fws = my feature workspace&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldChecker.Validate(fields, out enumFieldError, out validatedFields);&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;lt;--my OID field name is changed to "ObjectID"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcobjects 10.4.1‌objectid‌fieldname‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Apr 2019 21:04:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/why-does-ifieldchecker-change-the-name-of-oid/m-p/556644#M3747</guid>
      <dc:creator>WWalker</dc:creator>
      <dc:date>2019-04-26T21:04:21Z</dc:date>
    </item>
  </channel>
</rss>

