I am trying to set a definition query on a Application Lands layer in my project.mxd using arcpy. But it's not working for me. When I launch the project the query is in there but it doesn't get applied.
Can anyone help me out here?
import arcpy mxd = arcpy.mapping.MapDocument(r'C:\Users\Desktop\GIS PROGRAMMING\Project.mxd') Dockets = arcpy.mapping.ListLayers(mxd, "Application Lands") Applications= Dockets Applications.definitionQuery = '"Docket"' + " = " + "'1254-2017 '" mxd.save() del mxd