Hi
I have come across an unusual behavior in arcmap and kind of hit a real roadblock.
I have a Polygon layer(A) in an mxd that has been configured from a view in SQL-Server. The aim is to programmatically add a definition query, extract the geometry and use the selectByLocation tool to query features from another layer.
When configuring A, I selected an integer field(Pkey) as the object id field, select Finish , Apply, save and close the mxd.
I then reopen my mxd and apply a definition query to filter out a ERef(field from screenshot).
Now this is where I noticed the issue. After applying the definition query and hit zoom to layer I can see the feature on the map but not in the attribute table. As a result, when I use the select by location tool in my python script or even run it manually, it returns no results.
I have tried a couple of things like selecting a combination of different fields as the pkey and that did seem to work for a while until this started to happen again.
Some pointers on the way forward would be appreciated.
Regards
Nigel