Select to view content in your preferred language

FindField giving differing answers for ArcGIS Enterprise layers

177
0
09-12-2024 02:32 PM
ConnerPearce
New Contributor

I've got an issue with FindField giving different indexes depending on what class calls the method for ArcGIS Enterprise layers.

 

When i use FeatureClassDefinition.FindField("example") for ArcGIS Portal layers (That have a backing SDE) it may say that the field index is 4, however if I am using RowCursor.FindField("example") for the same layer it could return an index of 8.

 

Oddly enough if i use RowCursor.GetFields() and then find the index of the field it will be the same value as FeatureClassDefinition.FindField

 

Both are valid in their respective cases, the field "example" is at index 4 when working with a feature class and index 8 when working with a row cursor, but it only behaves this way with ArcGIS enterprise layers.

AGOL, normal SDE and File Geodatabase always return the same index regardless of how i call find field and so its causing issues with some code i have that caches field indexes, since the column location can change.

0 Kudos
0 Replies