4/28/2017

Changing the Default Sort in a Report Screen (ZPSQL & ZP32)

A customer asked if there was a way to change the default sort choice in their Violations Report Screen so that it always started on "Inspect Date." Looking at the sort choices in that screen I could see that that option was the fourth one in the list. To create the script in the User Defined Script Screen I chose "Zoning" as the Module, "ViiolateRep" as the Screen, and left "Screen" as the action. The actual script I entered was:

viorep.cmbsortby.listitemid = 4
viorep.sort_order = viorep.taglist(4,2)

Now when they enter that screen the default sort is the one they want. This script can be easily modified for other choices in the sorting list by changing the 4's in the script to the desired number. You can also use it for other report screens by substituting the proper screen name for "viorep".