Showing posts with label property. Show all posts
Showing posts with label property. Show all posts

1/14/2016

Referencing Rental Status in Property Screen (ZP32)

If you need to run reports on permits or violations issued to rental properties it can be useful to have the Property database itself indicate that the property is used for rental. The following script is a one-time run script that would be executed from the Database Browser screen script option. It will put the value "RENTAL" in the Property User7 field if said property has any kind of Rental record store.

update property set user7 = "RENTAL" from rental where rental.prop_id = property.prop_id

Now you run reports from any screen and used the Advanced Filter option to check the Property User7 field for "RENTAL" to get only application records issued to rental properties.

9/23/2013

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.

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.

3/23/2011

Archiving Previous Owners (ZP 32)

A ZP 32 customer has requested a script to log owner names if they change. She wants to add the old owner's name to the Notes field along with the date the change was made. The script uses "Base" for the Module, "Property" for the Screen, and "Save" for the Action.

if own_fname <> oldval("own_fname") or own_lname <> oldval("own_lname")
oldname = alltrim(trim(oldval("own_fname"))+" "+oldval("own_lname"))
replace notes2 with notes2 + "Old Owner: " + oldname + "  " +dtoc(date())
endif

NOTES
- This script is very sparse but it could be fleshed out easily to copy additional info such as the old owner's address (own_addr1 and own_addr2)
- This script can be easily modified to do the same thing for old occupants simply by changing each "own_" in the script to "occ_".

3/17/2011

Cover Photo for Windows Interface (ZP 32 or ZP SQL)

A while back I added a feature for ZP SQL customers where they could easily attach a "cover" photo to any property that would be viewed as part of the Staff web site when that property was viewed. Working with a customer today I explained that that same concept could be brought to the Windows interface for either ZP 32 or ZP SQL. The basic idea is that you have one photo you consider to be the main photo for a given property. I'm calling this photo the cover shot. You can store and display that photo easily in ZonePro using a script. This technique does not even require the Photo Module. Basically you just pick a location to store all such photos. A place on the server is best in a networked environment. Then you save the photos using an agreed upon naming scheme. For this script I am naming the photos after the property ID. Now I can easily create a generic script that will check my folder for the existence of such a photo for any given property and launch my default photo viewer for Windows. I added this script to the left-click action of the Script button on the Property Screen so the setup is "Base" for the Module, "Property" for the Screen and "Left" for the Action:

myfile = [c:\photo\]+property.prop_id + [.jpg]
if file(myfile)
shellexecute(0,"open",myfile,"","",1)
else
wait window "Cannot Find Photo " + myfile nowait
endif

1/12/2011

Archiving Fields in the Notes

I have a customer who wants to archive old data before they edit and change the value of certain fields. You can easily automate the archiving of various fields into one of the Notes fields by using a script. The example I'm using is archiving the Zoning District and the Existing Use fields in the Property Screen into the Notes1 field. The script copies the fields into the Notes when you click on the Script button while editing a Property record. This script uses "Base" for the Module, "Property" for the Screen, and "Left" for the Action:

if propscreen.isediting = .T.
replace notes1 with iif(empty(notes1),"",alltrim(notes1) +chr(13)+chr(13));
+ "ZONING ARCHIVED: "+dtoc(date()) + chr(13)+;
"Old Zoning: " + alltrim(zoning);
+"  Use: " + alltrim(exist_use)
propscreen.refresh
endif

In ZP 32 the "notes1" field should be referred to as "notes".

9/01/2010

Linking to Web Geocoding Options in ZP SQL

For ZonePro SQL there are some great mapping and geocoding options available in the Staff web site interface that are not available in the Windows interface. But, you can use a script to launch the key web page directly from the Property Screen in the Windows interface. Then you can use the web site to map the property, find and tag neighboring properties, or get driving directions. This script works great from either the Internet Link button or the User Script button. For this example we'll use the right-click option of the User Script button. In the User Scripts screen we added a new item using "Base" for the Module, "Property" for the Screen, and "Right" for the Action:

GoURL("http://www.zpdemo.zpuser.com/work/geocode/geomain.aspx?passedid="+property.prop_id)

Note that this script is for the ZP Demo web site. You would of course change that part of the URL to point to your own web site.

4/15/2010

Create Copies of Database for use with ArcView

A customer wanted to know how to access ZonePro databases from ArcView. I explained how ArcView chokes on Notes fields and how the ZP Copy program can be used to make copies of the databases minus the fields that ArcView can't handle. The ZP Copy program is really just another way of running scripts and you can do the same thing directly within ZonePro. By way of a demonstration, I wrote a script that runs from the Script button on the Main Screen that makes a copy of the Property database minus the Notes fields. You can then link ArcView to the "property_copy" database. This script uses "Base" as the Module, "MainScreen" as the Screen, and "Right" as the Action.

if file("property.dbf")
use property in 0
select property
copy to property_copy fields except note* fox2x
wait window "Copy Made" nowait
use in property

Note that this script only works with ZP 32.

3/22/2010

Customizing The Application Group Labels

At the bottom of the Property Screen there is a radio button control we call the Application Group button that lets you switch from Zoning to Building to Housing to General to Custom permit databases. We had a customer request to change the label of "General" to "Site Plan". We did it with a script that used "Base" as the Module, "Property" as the Screen and "Screen" as the Action.

propscreen.app_option.option4.caption = “SitePlan”

3/03/2010

Changing Field Labels

One of the most popular uses for User Defined Scripts in ZonePro is for changing the screen labels in front of fields. In this example I'm selecting "Base" as the Module, "Property" as the Screen, and "Screen" as the Action and my script is:

propscreen.zp_pageframe1.page2.lblFlood.Caption = "School"

This will change the "Flood" label on the Extra tab of the Property screen to now read "School." To create a script like this you need to know several things that typically require our involvement. You need to know that the internal name for the Property screen is "propscreen" and that the Extra tab is referenced as "zp_pageframe1.page2". Once you know that you can theoretically change the label for any field on that tab. The trickier bit is knowing that the Flood label is called "lblFlood".  Usually the label for a field is the same as the internal field name prefixed by "lbl", but unfortunately we were not always consistent in our naming habits. A quick e-mail to us though will get you the answers to the screen and label names you want to change.

Using Picasa for On-line Photo Storage

This is a repeat topic I recently entered in the ZonePro Journal blog. The idea is to use an on-line service such as Picasa for storing photos and then using a script to launch the photos. In this scenario I envision a customer creating a separate on-line photo album for each property. The name you give to the album will then be part of the URL that is used to later launch that page of photos from the ZonePro property screen. Whatever you name the album, you need to store that name in a field in the Property database so you can access it via a script and launch the site. Alternatively you could name each album after the Property ID so you don't have to waste a field, but then the album name would be meaningless outside the context of ZonePro. In my example I created an album in Picasa and named it after the address: LOWELL584. I then stored the value "LOWELL584#" in the User3 field of the Property database. Note the # sign. Picasa adds that when it creates its URLs but it may not be necessary. The rest of the URL is always a constant for my Picasa account. Your account would be different, of course. I'm going to use the User Script button to launch the web page and create a script that checks to make sure a value exists in User3 before attempting to launch the web page. To set up the script I use "Base" for the Module, "Property" for the Screen, and "Left" for the Action:

IF NOT EMPTY(property.user3)
GoURL("http://picasaweb.google.com/zonepro32/"+property.user3)
ENDIF