AnsweredAssumed Answered

Using FileMaker as a timelog/scan machine

Question asked by BradPatterson on Jul 5, 2015
Latest reply on Jul 6, 2015 by philmodjunk

Firstly let me start by saying I have very little real world FileMaker database experience, I've completed the Basic training and am working through the Advanced training, but have extremely limited experience working with real databases.

I've adopted a rather large and complex FileMaker database and I'm having some issues with some scripts that have been designed to record clock on/off times.  The system uses barcodes and scanners to log user information, job codes and times, however it is doing some strange things.

To the best of my knowledge at the moment the issue seems to be happening for the first person to log on every day and it records their time on the last day they logged on.  For example, if I logged on Monday morning it would add a time entry to Friday afternoon, so not even necessarily the previous day, just the previous day that an entry was recorded.

When the next person comes along (or if that first person scans on again) it works as it should and continues to work correctly for the rest of the day.

I initially though there must have been a problem with FileMaker not updating the date as these scan stations stay on 24/7, so I put a refresh window script in place to update the date, that has had no effect.

Below are the scripts:

 

Time Logon script

If [ Get ( LayoutName )="Log WA" ]
If [ IsEmpty(TimeLogItems::EmployeeID) & IsEmpty(TimeLogItems::JobScan) ]
Else
Perform Script [ “ClearWorkCentre” ]
End If
Set Error Capture [ On ]
Enter Browse Mode
Perform Script [ “Sequence Check for Timesheets items” ]
Set Field [ TimeLogItems::gMessage ; "" ]
Set Field [ TimeLogItems::gResult ; "" ]
Set Field [ TimeLogItems::gResult ; 0 ]
Set Field [ TimeLogItems::gMessage ; "Successful" ]
Pause/Resume Script [ Duration (seconds): 3 ]
Set Field [ TimeLogItems::StartNum ; Get ( CurrentTime ) ]
Set Field [ TimeLogItems::TimeCheck ; Get ( CurrentTime ) ]
Perform Script [ “Set JobNo” ]
Perform Script [ “Set Finish” ]
New Record/Request
Set Field [ TimeLogItems::gMessage ; "" ]
Set Field [ TimeLogItems::gResult ; "" ]
If [ Get ( LayoutName )="Log WA" ]
Set Field [ TimeLogItems::StartNum ; Get ( CurrentTime ) ]
Else
Set Field [ TimeLogItems::Finish ; Get ( CurrentTime ) ]
End If
End If
If [ Get ( LayoutName )="TimeLog" ]
Perform Script [ “ClearWorkCentre” ]
End If
Go to Field [ TimeLogItems::EmployeeID ]
[ Select/perform ]

 

ClearWorkCentre script

If [ IsEmpty(Timelogitems2Budget::WorkCentre) ]
Beep
Go to Field [ TimeLogItems::WorkCentre ]
[ Select/perform ]
Show Custom Dialog [ Title: "WorkCentre Error"; Message: "This is not a active Work Centre"; Default Button: “OK”, Commit:
“Yes” ]
Set Field [ TimeLogItems::EmployeeID ; "" ]
Set Field [ TimeLogItems::Employee ; "" ]
Set Field [ TimeLogItems::JobNo ; "" ]
Set Field [ TimeLogItems::JobScan ; "" ]
Set Field [ TimeLogItems::WorkCentre ; "" ]
Commit Records/Requests
[ Skip data entry validation; No dialog ]
Go to Field [ TimeLogItems::EmployeeID ]
[ Select/perform ]
Halt Script
End If

 

Sequence Check for Timesheets items script

If [ Left(TimeLogItems::WorkCentre;3)="003" ]
If [ Timelogitems2Employee_ID::TeamFolders ="Engineering Team QLD" or Timelogitems2Employee_ID::TeamFolders
="Engineering Team WA" ]
Else
Show Custom Dialog [ Title: "Error"; Message: "This workcentre can only be used by engineering - please rescan"; Default
Button: “OK”, Commit: “Yes” ]
Clear [ TimeLogItems::EmployeeID ]
[ Select ]
Clear [ TimeLogItems::Employee ]
[ Select ]
Clear [ TimeLogItems::JobScan ]
[ Select ]
Clear [ TimeLogItems::WorkCentre ]
[ Select ]
Go to Field [ TimeLogItems::EmployeeID ]
[ Select/perform ]
Halt Script
End If
End If

 

Set JobNo script

If [ WordCount ( TimeLogItems::JobScan ) 2 ]
Set Field [ TimeLogItems::JobNo ; LeftWords ( TimeLogItems::JobScan ; 1 ) ]
Set Field [ TimeLogItems::SubJobNo ; RightWords ( TimeLogItems::JobScan ; 1 ) ]
Else
Set Field [ TimeLogItems::JobNo ; TimeLogItems::JobScan ]
Set Field [ TimeLogItems::SubJobNo ; 1 ]
End If

 

Set Finish script

Set Field [ TimeLogItemsLogoff::Finish ; TimeLogItems::StartNum ]
Set Field [ TimeLogItemsLogoff::TimeCheckFinish ; Get ( CurrentTime ) ]
If [ TimeLogItems::WorkCentre="098" ]
Set Field [ TimeLogItems::Finish ; TimeLogItems::StartNum ]
Set Field [ TimeLogItems::TimeCheckFinish ; TimeLogItems::StartNum ]
End If

 

Any and all help will be greatly appreciated.

Outcomes