6/19/2017

E-mailing to All Contractors at Once (ZPSQL)

A customer asked if there is a way to send and e-mail to all of the contractors at once that have an e-mail address in ZP. While there is no way to do that in ZonePro itself, you can use a script to get a usable list of all the e-mail addresses that you can then paste into your regular e-mail program.

To enter the script go to User Defined Scripts in Maintenance. Select "Contractor" for the Module, leave the Screen at "Contractor" and change the Action to "Left". Then past the following script in and save it:

mycommand = [select distinct email from contract where email > '  ']
dosqlcommand(mycommand,'pickresult')
mylist = ''
select pickresult
go top
scan
mylist = mylist + TRIM(email)+[,]
endscan
mylist = left(mylist,len(mylist)-1)
_cliptext = mylist
strtofile(mylist,'contractor_emails.txt')
use in iif(used('pickresult'),'pickresult',0)
select contract
wait window "Emails copied to Windows Clipboard" nowait

Now go to any Contractor record in the Contractor Screen and left-click on the User Script icon (the book). This creates a comma-separated list of contractor e-mails and saves it to the Windows clipboard so that you can paste it in another mail program. It also saves a text file of this under the file name "contractor_emails.txt." You can edit text file or copy and paste from it also.

5/22/2017

Changing the Default Dates in Contractor Docs Screen (ZPSQL)

The Contractor Docs screen displays a Start and End date that can be used for license printing. At the beginning of the year the date range is January to December, but then it automatically switches to July to June later in the year. I had a customer who wanted to keep the dates at January to December no matter what. This is how you do it. Start a script for the "Contractor" Module. Choose "ContDoc" for Screen, and leave the Action at "Screen". The script would be:

contdocs.startday = "January "+STR(YEAR(DATE()),4)
contdocs.endday = "December "+STR(YEAR(DATE()),4)

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".