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.