<?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 CreateStandaloneTable does not assign an OBJECT ID field. in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/createstandalonetable-does-not-assign-an-object-id/m-p/1358658#M10833</link>
    <description>&lt;P&gt;Is there a way to designate what column is the object ID when creating a standalone table from an oracle database?&lt;/P&gt;&lt;P&gt;When I am creating a standalone table using the StandaloneTableFactory it does not assign a Field as&amp;nbsp; the OBJECT ID type.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;                    using (Geodatabase geodatabase = new Geodatabase(connectionProperties))
                    using (Table worktable = geodatabase.OpenDataset&amp;lt;Table&amp;gt;(queryTableName))
                    {

                        var tableParams = new StandaloneTableCreationParams(worktable)
                        {
                            Name = queryTableName, 
                            
                        };

                        // creates the standalone table.
                        StandaloneTableFactory.Instance.CreateStandaloneTable(tableParams, MapView.Active.Map);
                    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If the standalone table does not have an OBJECT ID it seems to have a tendency to not let the attribute table be viewed once the table is converted to a XY Event Layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; var uri = standaloneTable.URI;

            List&amp;lt;object&amp;gt; arguments = new List&amp;lt;object&amp;gt;
            {
                // URI of the standalone table to be projected on the map
                standaloneTable.URI,

                // X Value column
                "LON",

                // Y Value comlumn
                "LAT",

                // Where to change the name of the standalone table
                tableName,

                // Spatial referance  4326 = GCS_WGS_1984 Coordinate system
                SpatialReferenceBuilder.CreateSpatialReference(4326),
            };

            // Takes the standalonetable and makes a XY Event layer
            await Geoprocessing.ExecuteToolAsync($"MakeXYEventLayer_management", Geoprocessing.MakeValueArray(arguments.ToArray()));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now If I got to the database in the catalog view and then just drag the table in to the MapView it creates the standalone table with a column with unique values as the OBJECT ID, thus allowing the XY Event Layer to be created and its attribute layer visible.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Dec 2023 17:23:15 GMT</pubDate>
    <dc:creator>TrentSchweitzer</dc:creator>
    <dc:date>2023-12-08T17:23:15Z</dc:date>
    <item>
      <title>CreateStandaloneTable does not assign an OBJECT ID field.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/createstandalonetable-does-not-assign-an-object-id/m-p/1358658#M10833</link>
      <description>&lt;P&gt;Is there a way to designate what column is the object ID when creating a standalone table from an oracle database?&lt;/P&gt;&lt;P&gt;When I am creating a standalone table using the StandaloneTableFactory it does not assign a Field as&amp;nbsp; the OBJECT ID type.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;                    using (Geodatabase geodatabase = new Geodatabase(connectionProperties))
                    using (Table worktable = geodatabase.OpenDataset&amp;lt;Table&amp;gt;(queryTableName))
                    {

                        var tableParams = new StandaloneTableCreationParams(worktable)
                        {
                            Name = queryTableName, 
                            
                        };

                        // creates the standalone table.
                        StandaloneTableFactory.Instance.CreateStandaloneTable(tableParams, MapView.Active.Map);
                    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If the standalone table does not have an OBJECT ID it seems to have a tendency to not let the attribute table be viewed once the table is converted to a XY Event Layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; var uri = standaloneTable.URI;

            List&amp;lt;object&amp;gt; arguments = new List&amp;lt;object&amp;gt;
            {
                // URI of the standalone table to be projected on the map
                standaloneTable.URI,

                // X Value column
                "LON",

                // Y Value comlumn
                "LAT",

                // Where to change the name of the standalone table
                tableName,

                // Spatial referance  4326 = GCS_WGS_1984 Coordinate system
                SpatialReferenceBuilder.CreateSpatialReference(4326),
            };

            // Takes the standalonetable and makes a XY Event layer
            await Geoprocessing.ExecuteToolAsync($"MakeXYEventLayer_management", Geoprocessing.MakeValueArray(arguments.ToArray()));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now If I got to the database in the catalog view and then just drag the table in to the MapView it creates the standalone table with a column with unique values as the OBJECT ID, thus allowing the XY Event Layer to be created and its attribute layer visible.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 17:23:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/createstandalonetable-does-not-assign-an-object-id/m-p/1358658#M10833</guid>
      <dc:creator>TrentSchweitzer</dc:creator>
      <dc:date>2023-12-08T17:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: CreateStandaloneTable does not assign an OBJECT ID field.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/createstandalonetable-does-not-assign-an-object-id/m-p/1359419#M10841</link>
      <description>&lt;P&gt;I think you should be able to use Geodatabase DDL to modify that table using&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;schemaBuilder&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;Modify&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;modifiedTableDescription&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-DDL#adding-or-removing-fields" target="_blank" rel="noopener"&gt;ProConcepts DDL · Esri/arcgis-pro-sdk Wiki (github.com)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create an object ID field use this code snippet:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Geodatabase#objectid-field" target="_blank" rel="noopener"&gt;ProSnippets Geodatabase · Esri/arcgis-pro-sdk Wiki (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 22:05:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/createstandalonetable-does-not-assign-an-object-id/m-p/1359419#M10841</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-12-11T22:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: CreateStandaloneTable does not assign an OBJECT ID field.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/createstandalonetable-does-not-assign-an-object-id/m-p/1361046#M10871</link>
      <description>&lt;P&gt;Thanks for the suggestion, changing the DDL of the tables not something I am able todo as I have other services that touch these tables as well.&lt;BR /&gt;&lt;BR /&gt;The main issue that I am having that I thought I was due to the tables not having an object ID assigned is when opening the attribute table of a feature layer I am getting and error "Failed to retrieve a page of rows" this seems to happen on a majority of feature layers.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 18:53:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/createstandalonetable-does-not-assign-an-object-id/m-p/1361046#M10871</guid>
      <dc:creator>TrentSchweitzer</dc:creator>
      <dc:date>2023-12-14T18:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: CreateStandaloneTable does not assign an OBJECT ID field.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/createstandalonetable-does-not-assign-an-object-id/m-p/1363547#M10932</link>
      <description>&lt;P&gt;It turns out these tables were not being registered with the geodatabase. In case anyone else runs in to this mistake here is the code I used to resolve it.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;            List&amp;lt;object&amp;gt; arguments = new List&amp;lt;object&amp;gt;
            {
                // URI of the standalone table to be projected on the map
                standaloneTable.URI,

                // OBJECTID Value column
                "UNIQ_ID",
            };

            // Takes the standalonetable URI and makes and registers with the geodatabase
            var results=   await Geoprocessing.ExecuteToolAsync($"RegisterWithGeodatabase_management", Geoprocessing.MakeValueArray(arguments.ToArray()));&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 21 Dec 2023 13:46:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/createstandalonetable-does-not-assign-an-object-id/m-p/1363547#M10932</guid>
      <dc:creator>TrentSchweitzer</dc:creator>
      <dc:date>2023-12-21T13:46:27Z</dc:date>
    </item>
  </channel>
</rss>

