1/14/2011

Who Scheduled That?

Had a customer ask if there was a way they could keep track of who scheduled a particular Building Inspection and when. I devised a script that checks to see when the Next Inspection date changes and then replaces the Last Time field with the current users initials and the month and day. This script uses "Building" for the Module, "Buildinsp" for the Screen, and "Save" for the Action:

if insp_date <> oldval("insp_date")
replace last_time with trim(zonepro.owner)+left(dtoc(date()),5)
endif

NOTES
- It is the OLDVAL( ) function that checks to see if the Next Inspection date field has changed during editing.
- This script is not of any use in ZP 32 if you are not using Security.
- For ZP SQL you would change "zonepro.owner" to "zpsecure.ownint".
- There are only a handful of fields available to stick this info into. I chose Last Time because this field should be blank when you are scheduling a new inspection.