A customer asked me today if there was a way to set a new default value for the Max Rows field on report screens. The Max Rows value determines the maximum number of records pulled by a SQL query when running a report. It defaults to 100 records which is sufficient for most reports but in their case was not enough for the Building Combo Reports screen. This script sets the value to zero for that screen which removes the restriction on the number of rows a query can pull. The script uses "Building" for the Module, "BldCombo" for the Screen, and "Screen" for the Action.
rep_combo.max_rows.value = 0
Showing posts with label zpsql. Show all posts
Showing posts with label zpsql. Show all posts
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:
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.
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.
3/03/2010
Auto Numbering License in Contractor Screen
Yesterday I talked to a ZP SQL customer about automatically bumping up the number in the License field of the Contractor Screen in a fashion similar to Permit Number fields. I had already covered this topic for ZP 32 but the code is slightly different for ZP SQL. In this case the customer uses a numbering scheme like "C10-001" where 10 represents 2010. The script I created used the User Script button. While editing, clicking on the User Script button automatically fills in the next higher number in the License field. This scripts uses "Contractor" as the Module, "Contractor" as the Screen, and "Left" as the Action. Here is the script:
IF contscreen.isediting = .T.
myCommand = [SELECT MAX(license) AS maxnum FROM contract]
DoSqlCommand(myCommand,'myLicense')
myLast = VAL(RIGHT(TRIM(myLicense.maxnum),3))+1
myNext = LEFT(myLicense.maxnum,4)+PADL(ALLTRIM(STR(MYLast)),3,"0")
USE IN IIF(USED('myLicense'),'myLicense',0)
SELECT contract
REPLACE license WITH myNext
contscreen.ZP_PAGEFRAME1.PAGE1.TXTLICENSE.REFRESH
ENDIF
IF contscreen.isediting = .T.
myCommand = [SELECT MAX(license) AS maxnum FROM contract]
DoSqlCommand(myCommand,'myLicense')
myLast = VAL(RIGHT(TRIM(myLicense.maxnum),3))+1
myNext = LEFT(myLicense.maxnum,4)+PADL(ALLTRIM(STR(MYLast)),3,"0")
USE IN IIF(USED('myLicense'),'myLicense',0)
SELECT contract
REPLACE license WITH myNext
contscreen.ZP_PAGEFRAME1.PAGE1.TXTLICENSE.REFRESH
ENDIF
Subscribe to:
Posts (Atom)