What's the best way to get the OBJECTID name of a feature class?
I know you can use "OID@" in a cursor to get the field, but can you get the name from that as well?
I'm writing a script, and need to take into account varying OBJECTID names, like OBJECTID_2, OBJECTID_12, FID, etc. that will be used in a query.
Is using Describe the only way to get the name?
For example:
oid_field = [field.name for field in arcpy.ListFields("FC") if field.type == "OID"]
I'm just wondering if there's another way.
Thanks.