Showing posts with label default values. Show all posts
Showing posts with label default values. Show all posts

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)

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.


4/15/2010

Set A Default Permit Type in Other Permits

In Copley Township they use the Other Permits database to track culvert deposit fees. Since it is the only thing they track in that database they wanted an easy way to fill in the Type field consistently every time they add a new record. This script uses "Misc Fee" as the Module, "Other" as the Screen and "Add" as the Action:

replace other.type with "CULVERT DEPOSIT"

You can use this approach to create default values for almost any fields in any database.