I am wanting to create a definition query on a standalone table using arcpy. I have a way set up to do it on a layer file but because a table isn't a layer file this code obviously doesn't work.
The line of code that is bold is where things go wrong, because its not a layer. Is there a function similar to map_obj.listLayers for tables that I am missing?
# Access the map and the layer
map_obj = aprx.listMaps(map_name)[0]
layer_obj = map_obj.listLayers(layer_name)[0]
# Set a simple definition query
definition_query = f"{field_name} = '{query_value}'"
layer_obj.definitionQuery = definition_query