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".
Showing posts with label violations. Show all posts
Showing posts with label violations. Show all posts
5/27/2016
Using Login Credentials to Fill Initial Fields (ZPSQL)
Because you have to login to use ZP SQL, the system knows who you are and can add your initials to a field automatically if desired. Your initials are stored in a system variable called ZPSECURE.OWNINIT. So if you want to always have your initials added to the Received By field in the Violations Screen each time you add a new violation record you can do so by creating a script for the "Add" action for the "Violations" screen:
replace comp_recv with zpsecure.owninit.
If you want to prevent anyone from editing that info once it is added automatically, just add another line to your script:
vlscreen.zp_pageframe1.page2.txtComp_recv.enabled = .F.
If you really want to lock down that info you should also create a script for the "Edit" action that repeats that second line of the script.
replace comp_recv with zpsecure.owninit.
If you want to prevent anyone from editing that info once it is added automatically, just add another line to your script:
vlscreen.zp_pageframe1.page2.txtComp_recv.enabled = .F.
If you really want to lock down that info you should also create a script for the "Edit" action that repeats that second line of the script.
4/15/2010
Violation Warning for Owners
At Huber Heights they have a particular landlord that wants to be notified immediately whenever one of his properties has a violation. We created a script that displays a message whenever that owner's name is involved. This script uses "Zoning" as the Module, "Violations" as the Screen and "Add" as the Action which means it will run when you click on the User Script Button in the Building Screen.
To use this scrip in ZP SQL I would change it slightly:
This script works fine if you have only a few such landlords to track, but would become unwieldy quickly. Another approach would be to key off a value in the Property database that you fill in to indicate you want a message displayed. You could use the USER4 field for example and the value "NOTIFY" to trigger the script. Your script would then look like this for both ZP 32 and ZP SQL:
This option is really just a variation of the built-in Alert Message feature.
if property.own_lname = "PARK REALTY"
= messagebox("Call Bob Watson at Park Realty about this!", 16, "Notify")
endif
To use this scrip in ZP SQL I would change it slightly:
if propnames.own_lname = "PARK REALTY"
= messagebox("Call Bob Watson at Park Realty about this!", 16, "Notify")
endif
This script works fine if you have only a few such landlords to track, but would become unwieldy quickly. Another approach would be to key off a value in the Property database that you fill in to indicate you want a message displayed. You could use the USER4 field for example and the value "NOTIFY" to trigger the script. Your script would then look like this for both ZP 32 and ZP SQL:
if property.user4 = "NOTIFY"
= messagebox("Call owner about this!", 16, "Notify")
endif
This option is really just a variation of the built-in Alert Message feature.
3/22/2010
Preventing Violation Type Editing
The City of Whitehall wanted a way to prevent users from changing the Violation Type of existing violations. This was accomplished with two scripts. Both scripts use "Zoning" as the Module and "Violations" as the Screen. The first script uses "Edit" as the Action and it disables the Violation Type drop down box when editing:
vlscreen.zp_pageframe1.page1.cmbVio_type.enabled = .F.
Another script is need for the “Add” Action to make sure the drop-down box works when you are adding new violations:
vlscreen.zp_pageframe1.page1.cmbVio_type.enabled = .T.
vlscreen.zp_pageframe1.page1.cmbVio_type.enabled = .F.
Another script is need for the “Add” Action to make sure the drop-down box works when you are adding new violations:
vlscreen.zp_pageframe1.page1.cmbVio_type.enabled = .T.
3/03/2010
Changing the Default Document
By default the document screen for any database always has the top document option selected when the screen is launched. We had a customer who wanted to default to the Nuisance Letter option instead of the Violation Letter when the Violation Documents screen launched. To do this we created a script that used "Zoning" as the Module, "ViolateDoc" as the Screen, and "Screen" as the Action. The script is:
vdocs.doc_select.value = 4
vdocs.doc_select.value = 4
Subscribe to:
Posts (Atom)