I am wondering if it is possible to build a zoom to geoprocessing service without using 'current' for the MXD variable in Python? Using 'current' my tool works in ArcMap, but not in my geoprocessing service.
Here is my code that work fine locally in ArcMap:
import arcpy MXD=arcpy.mapping.MapDocument('current') dataframe = arcpy.mapping.ListDataFrames(MXD, "Web Mercator") dataframe.zoomToSelectedFeatures() arcpy.RefreshActiveView()
When I publish my service, the zoom feature no longer works. I have read online that you can't use 'current' in a geoprocessing service, that's fine. When I enter the path to the MXD, the zoom function no longer works.