A customer asked if it possible to change the default 30 day date range in a report screen. Using a script you can set the From date to any value you wish. Using the Rental Report Screen as an example the script would be:
rentrep.txtStartdate.value = DATE() - 60
Where the 60 value determines how many days back the range goes. This value is 30 by default but you can reset it using this script to any value you want. This approach should work for any report screen.
10/01/2014
Set A Default Date Type in Rental Reports Screen (ZPSQL & ZP32)
By default no date field is set when you enter the Rental Report Screen. You can use a script to change this. A customer just requested a way to make the Enter Date the default date field. To do this you start a new script in the User Defined Scripts Screen using "Housing" as the Module, "RentRep" as the Screen and "Screen" as the Action. The script itself would be:
rentrep.date_type="ent_date"
rentrep.cmbUsedate.value = "Enter Date"
Now when you first enter the Rental Report Screen the Enter Date will be shown as the default date type.
rentrep.date_type="ent_date"
rentrep.cmbUsedate.value = "Enter Date"
Now when you first enter the Rental Report Screen the Enter Date will be shown as the default date type.
9/23/2013
Special Time Clock Script (ZPSQL)
In several of the screens that track inspection you can launch a Time Clock box that lets you fill in the Inspection Time field by selecting a pre-defined value from a list. Recently a customer asked if there was a way to customize the time options offered in the Time Box list. Now you can by creating a special script file that is editable in the User Defined Scripts Screen. The file should be called script_timeclock.txt and the format is simply a series of time values separated by commas. A example script might be:
AM 08:00,AM 08:30,AM 09:00,AM 09:30,AM 10:00,AM 10:30,AM 11:00,AM 11:30,PM 12:00,PM 12:30,PM 01:00,PM 01:30
Whenever the Time Box is launched it looks to see if the a script file exists before either loading that script or defaulting to it's own list of times. You can create this text file yourself and place it in the main installation folder or download a starting script from our web site at Time_Clock_Script. Either way you can edit the list in the User Defined Scripts Screen to make it suit your needs.
AM 08:00,AM 08:30,AM 09:00,AM 09:30,AM 10:00,AM 10:30,AM 11:00,AM 11:30,PM 12:00,PM 12:30,PM 01:00,PM 01:30
Whenever the Time Box is launched it looks to see if the a script file exists before either loading that script or defaulting to it's own list of times. You can create this text file yourself and place it in the main installation folder or download a starting script from our web site at Time_Clock_Script. Either way you can edit the list in the User Defined Scripts Screen to make it suit your needs.
Special Script for Renaming Application Buttons (ZPSQL)
You can add a special script file to your installation folder that allows you to rename the Application Buttons that appear at the bottom of the Property Screen. This feature has existed for a while but I have changed the naming scheme of the files so that now the text can be easily edited in the User Defined Script Screen. By default there are four Application Button categories that each have five pre-defined buttons. The four groups are Zoning, Building, Housing and General. When the screen switches categories it looks to see if a script file exists for that category and uses the new button names if it is found. Each category has it's own script files. The file names are script_property_btnzoning.txt, script_property_btnbuilding.txt, script_property_btnhousing.txt or script_property_btngeneral.txt. A look at the Zoning button script shows what the text would look like:
%Zoning%Violations%Amend%Non-Conform%Appeals%
You can simply edit the names in between the percentage signs to change the name as it appears on the screen. The format is simple enough that you could create the text file yourself or you can download the set from our website at App Button Scripts. This file contains several files but you only need to copy the one you want to change into your main installation folder. It will then appear as choice in the User Defined Scripts Screen where you can edit it.
%Zoning%Violations%Amend%Non-Conform%Appeals%
You can simply edit the names in between the percentage signs to change the name as it appears on the screen. The format is simple enough that you could create the text file yourself or you can download the set from our website at App Button Scripts. This file contains several files but you only need to copy the one you want to change into your main installation folder. It will then appear as choice in the User Defined Scripts Screen where you can edit it.
5/30/2013
Easy Photo and File Linking in the Property Screen
One of the easiest ways I have discovered to link photos or files back to a Property record is to use a script that simply looks for a folder based on the address of the property. I have been talking about this concept a lot lately so it bears writing about again. This approach is completely independent of the Photo Module and instead relies on creating a simple structure of folders to house the files. When the user clicks on the Script Button in the Property screen the script finds the folder that matches the address and launches it in Windows Explorer so that the user can easily see the contents of the folder. Using thumbnail views you can quickly see the contents of photos, PDFs, Word files or whatever. The user can just drag and drop any file they desire into the folder which makes it super easy and quick to populate. The script below has an added feature where it creates the folder for you if it did not previously exist. In this script I use the Street Name followed by the Street Number to name the folders but you could use other Property fields instead. This naming scheme is easy to maintain though and has the big advantage of making sense outside of ZonePro as well. This script uses the "Base" Module, the "Property" Screen and the "Left" Action.
myfolder = "C:\Photos\" + trim(street)+" "+trim(st_nr)
if directory(myfolder)
shellexecute(0,"open",myfolder,"","",1)
else
mkdir (myfolder)
shellexecute(0,"open",myfolder,"","",1)
endif
This script shows the base location as "C:\Photos\" but in most cases this would refer to a location on a shared server. There is a Training Video from last year that shows how this works with a simpler version of the script.
myfolder = "C:\Photos\" + trim(street)+" "+trim(st_nr)
if directory(myfolder)
shellexecute(0,"open",myfolder,"","",1)
else
mkdir (myfolder)
shellexecute(0,"open",myfolder,"","",1)
endif
This script shows the base location as "C:\Photos\" but in most cases this would refer to a location on a shared server. There is a Training Video from last year that shows how this works with a simpler version of the script.
8/01/2012
Changing Label Colors (ZP SQL & ZP 32)
I have written before about how to use a script to change the text assigned to a field label. Today I had a customer ask if you could also change the color of the label to make it stand out. In this example I'm selecting "Base" as
the Module, "Property" as the Screen, and "Screen" as the
Action and my script is:
The first line changes the label for the Existing Use field on the Property Screen to "Warning." The second line makes that label red. To change the color of a field you enter in three Red/Green/Blue values from 0 to 255. Different values produce the rainbow of colors. You can use a number of web sites to learn the RGB values for any color you desire.
propscreen.zp_pageframe1.page1.lblExist_use.Caption =
"Warning"
propscreen.zp_pageframe1.page1.lblExist_use.Forecolor = RGB(255,0,0)
The first line changes the label for the Existing Use field on the Property Screen to "Warning." The second line makes that label red. To change the color of a field you enter in three Red/Green/Blue values from 0 to 255. Different values produce the rainbow of colors. You can use a number of web sites to learn the RGB values for any color you desire.
3/15/2012
Forcing Final Date Fill Ins (ZP SQL)
A customer recently asked if there was a way to force the filling in of the Final Date field after a "FINAL" inspection was completed in the Building Inspection Details Screen. This script does just that assuming you have an inspection type called "FINAL" and that your result value is "APPROVED." If those conditions are met and the Final Date field is empty in the Building Screen, the script will fill in today's date and put you in Edit Mode in the Building Screen after you exit the Inspection Details Screen. This script uses "Building" for the Module, "Buildinsp" for the Screen, and "Save" for the Action:
if detail1.detail = "FINAL" and detail1.iresult = "APPROVED" and ISNULL(build1.occ_date)
= messagebox("Be sure to check Final Date in Building Screen",64,"Alert")
CURSORSETPROP('Buffering',4,'build1')
replace build1.occ_date with date()
buildscreen.isediting = .T.
endif
if detail1.detail = "FINAL" and detail1.iresult = "APPROVED" and ISNULL(build1.occ_date)
= messagebox("Be sure to check Final Date in Building Screen",64,"Alert")
CURSORSETPROP('Buffering',4,'build1')
replace build1.occ_date with date()
buildscreen.isediting = .T.
endif
Subscribe to:
Posts (Atom)