Select to view content in your preferred language

Error when adding new element - feature not editable

1322
7
12-12-2013 02:59 AM
AnatoliiTerentiev
Deactivated User
Deat Gurus!
I try test adding feature from browser. I can edit existing features, but when trying to add - I get error - "Field is not editable". (Picture attached)
How to fix?
Tags (2)
0 Kudos
7 Replies
WilliamCraft
MVP Alum
Can you provide a complete list of the fields and their data types for the particular table in question?
0 Kudos
AnatoliiTerentiev
Deactivated User
As such, satisfied? (picture attached)
CREATE TABLE [dbo].[events](
[id] [int] IDENTITY(1524,1) NOT NULL,
[name] [nvarchar](255) NULL,
[event_type] [int] NULL,
[numeric](11, 2) NULL,
[numeric](11, 2) NULL,
[Shape] [geometry] NULL,
[ObjectID] [int] NOT NULL,
CONSTRAINT [R8_pk] PRIMARY KEY CLUSTERED
(
[ObjectID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 75) ON [PRIMARY]
) ON [PRIMARY]
0 Kudos
AnatoliiTerentiev
Deactivated User
In the field list  - a field "id" - identity. And there is a field ObjectID, which was added during the registration table in the geodatabase. I deleted the id - and the addition was working. I am  thinking - why? I have read somewhere, that if  the source table  has identity - field  then it turns into a type ObjectID, but in my case, was created a new field...
0 Kudos
WilliamCraft
MVP Alum
Your tables's ID field is NOT NULL, which means that it must have a value to add when performing an insert.  The body of your REST call for the insert does not pass an ID value so that is the reason for the failure.  OBJECTID is an ArcSDE-maintained field for a unique identifier so it gets a value populated automatically by the system during insert operations.  Deleting the ID field is certainly one way to solve the problem depending on your data model requirements.
0 Kudos
AnatoliiTerentiev
Deactivated User
Thank you. Is there are any way when table is registering in geodatabase , field ID was taken as a field of ObjectID type?
0 Kudos
WilliamCraft
MVP Alum
I believe you can specify a "custom" identifer field in place of the default OBJECTID field that ArcGIS creates.  When using the sdelayer -o register command to reigster your table with ArcSDE, specify the field you want in the -C parameter as such:

sdelayer -o register -l <table,column> [-e <entity_mask>]
          {[-C NONE] | [-C <row_id_column>[,{SDE|USER}[,<min_ID>]]]}
          [Spatial_Index] [-S <layer_description_str>] [-q]
          [-k <config_keyword>] [-i <service>] [-s <server_name>]
          -u <DB_User_name> [-p <DB_User_password>] [-D <database>]

Note: the custom field you specify needs to be of number(38) data type.
0 Kudos
AnatoliiTerentiev
Deactivated User
Thank you very much! Now I was asked to add some new properties in one of the previous program with arcobjects. Then I will return to this problem.
0 Kudos