Showing posts with label rental. Show all posts
Showing posts with label rental. 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.

10/03/2014

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

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.

1/27/2011

Copy and Pasting Fields Between Records (ZP 32 or ZP SQL)

A customer using the Rental Screen wanted to be able to copy information from the existing rental record whenever they added a new one. There is a built-in carry-over option in the Rental Screen if you right-click on the Add button, but that option does not copy all the fields this customer needed. I devised the following script as a way to copy and paste multiple fields at a time between any two records in the same database. This script uses "Housing" for the Module, "Rental" for the Screen and "Left" for the Action:

myaction = inputbox("Enter C to Copy or P to Paste")
if lower(myaction) = "c"
javascript:void(0)
wait window "copying fields..." nowait
public mydata
mydata = createobject("empty")
addproperty(mydata,"user1",rental.user1)
addproperty(mydata,"user2",rental.user2)
addproperty(mydata,"user3",rental.user3)
addproperty(mydata,"user6",rental.user6)
addproperty(mydata,"notes1",rental.notes1)
endif
if lower(myaction) = "p"
wait window "pasting fields..." nowait
if vartype(mydata) = "o"
rescreen.isediting = .t.
gather name mydata memo
release mydata
endif
rescreen.refresh
endif

NOTES
- This script crams both the Copy and Paste actions into one button (the left click Script button) with a prompt to decide which action to take. You could also easily split this into two scripts and put the Copy action in the left click and the Paste action in the right click and drop the prompt code.
- You can revise a script like this to work with any of the ZP databases and with any number of fields.
- Note that the Paste option puts you into Edit Mode, which means you can Cancel the Edit to negate the paste.

3/22/2010

Adding Items To Drop-Down Lists

At the City of Sandusky they wanted the option of “Court” to appear in the Billing Status drop-down box on the Rental Screen. Turns out you can use a script to add new options to the fixed list drop-down boxes in ZonePro. To accomplish this we used "Housing" as the Module, "Rental" as the Screen, and "Screen" as the Action.

rescreen.zp_pageframe1.page1.cmbBstatus.rowsource =;
rescreen.zp_pageframe1.page1.cmbBstatus.rowsource + ",Court"
rescreen.zp_pageframe1.page1.cmbBstatus.requery