Showing posts with label contact file. Show all posts
Showing posts with label contact file. Show all posts

9/19/2016

Selectively Hiding the Social Security Number on Contact Screen (ZPSQL)

A customer just asked if there was a way to selectively hide the Social Security number field on the Contact File Screen so that only certain users could see it. The most reasonable way to do this would be by Security Access Level. The script below hides both the number field and its label if the user's security level is over 2. This script was created using "Contact File" for the Module, "Contact" for the Screen, and "Screen" for the Action:

if zpsecure.cfs > 2
if wexist('propscreen')
cfscreen.zp_pageframe1.page2.txtSs_num.visible = .F.
cfscreen.zp_pageframe1.page2.lblSs_num.visible = .F.
else
cfscreen2.zp_pageframe1.page2.txtSs_num.visible = .F.
cfscreen2.zp_pageframe1.page2.lblSs_num.visible = .F.
endif
endif


You'll notice there appear to be two sets of screen references. This is because there are two Contact Screens: one launched from the Main Screen and one from the Property Screen.

It is worth noting you can also use the security setting to block printing of the field in any document by adding "zpsecure.cfs>2" to the Print When section in the approriate field properties via the Document Editor.

2/02/2011

Selecting Any Contact As Applicant (ZP SQL)

A ZP SQL customer just requested an option that would allow them to select any name linked to the Property as an Applicant. In this case they were working in the Planning screen. I devised a script using the left-click Script button that brings up a browse screen showing all Contact names. When the user selects one, that name is automatically copied into the Applicant fields. Notice that the customer also wanted to copy additional Contact information into the User fields. This script only runs when you are editing a record. The script uses "Planning" for the Module, "Planing" for the Screen, and "Left" for the Action:

if planscreen.isediting
select planning
mycommand = [select rtrim(firstname)+' '+rtrim(lastname) as name,;
rtrim(st_nr)+' '+rtrim(street)+' '+rtrim(st_extra) as address1,;
address2,phone1,phone2,email,cftype from vcfsolorep where prop_id = ']+ prop_id +[']
dosqlcommand(mycommand,'mynames')
select mynames
on key label spacebar keyboard chr(23)
on key label rightmouse keyboard chr(23)
on key label enter keyboard chr(23)
browse normal in window mainzone noedit;
title "Select applicant name..."
on key label spacebar
on key label rightmouse
on key label enter
replace planning.app_type with mynames.cftype,;
planning.app_name with mynames.name,;
planning.app_phone with mynames.phone1,;
planning.app_addr1 with mynames.address1,;
planning.app_addr2 with mynames.address2,;
planning.user1 with mynames.phone2,;
planning.user3 with mynames.email
use in iif(used('mynames'),'mynames',0)
select planning
planscreen.refresh
endif