GetLayersAsFlattenedList is not picking feature layer from sql views in 3.2 from addin of 3.0

610
1
12-07-2023 02:43 PM
XetefXita
New Contributor

I have created an add-in using that applies definition query on the layer selected from the active map. I am using below line to get the list of all the attributes/columns, which are available in the layer selected. 

 

 

 var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().First(f => f.Name == layer);

 

it works fine, when i have a shapefile or featre class loaded from the local file system, but when i have a sql view loaded from the database, it gives me error of "Invalid Implementation of GlobalGeodatabase"

When i used this add-in in arcgis pro 3.0 it works fine with everything, and it loads all the attributes perfectly. But it does not work in 3.2, it gives error. 

 

Why it's not picking the fields of feature layer 

 

var attributes = featureLayer.GetFeatureClass().GetDefinition().GetFields();

this is to get the attributes.

 

0 Kudos
1 Reply
CharlesMacleod
Esri Regular Contributor

can you try layer.GetFieldDescriptions() instead?

https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic11388.html

0 Kudos