You are viewing limited content. For full access, please sign in.

Question

Question

Need help creating a time tracking form

asked on January 23, 2018

I've been using Laserfiche for 9 months and most of my work revolves around Quick Fields and Workflow.  Recently I was assigned with the task of creating a time tracking form for a handful of employees to keep track of the time they spend scanning, indexing, etc.  This will be my first time using LF Forms.  

So far I have the layout of the form created.  The employee chooses their name and job(scanning, indexing, etc.) from drop down menus, then enters the date, start time, and stop time.  When the employee hits submit, I want to calculate the time based on the start and stop time and then have that information saved so it can be accessed for reports later.  

Any tips or recommendations for this form?  Creating the form itself was easy, but I'm looking at the process that needs setup behind the scenes and I'm really not sure where to start.  I'm afraid I may be making this more complicated than it needs to be.  

0 0

Replies

replied on January 23, 2018

Hi Justin,

Have you checked out the Business Process Library? There is a process there called CSS, JavaScript, and Formula Examples that might suit your need. Here's a formula snippet from that process:

Formula to determine day of week:
=CHOOSE(WEEKDAY(INDEX(TimeTable.Date, ROW())),"SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY")

Formula to calculate the time difference in hours:
=ROUND((VALUE(INDEX(TimeTable.End_Time, ROW())) - VALUE(INDEX(TimeTable.Start_Time, ROW()))) * 24, 2)

Formula to sum up hours:
=SUM(TimeTable.Hours)

I've also attached a screenshot of what the above formulas achieve. Hope this helps! 

hourscalc.png
hourscalc.png (10.5 KB)
1 0
replied on February 20, 2018 Show version history

Hi Karina,

Thanks so much for posting this and including the information about CSS, JavaScript, and Formula Examples.  It is extremely helpful.  I'm using the code to fill in the Day of the Week. It works great for the first row.  However, when I add a row, it initially gives an error "This field contains a calculation error. References: Time Table Date" until I fill in a date.  Is there a way to get rid of this message without having to set the default value for the date field to CurrentDate?

 

Thanks,
Jen

0 0
replied on February 20, 2018

Hi Jen,

I see what you mean, that's not the best user experience. Here's a modified version of the formula for the Day of Week calculation:

=IF(NOT(EXACT(INDEX(TimeTable.Date, ROW()), "")),CHOOSE(WEEKDAY(INDEX(TimeTable.Date, ROW())),"SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"), "")

It looks a little long but what I've done is nested the original choose function into an if statement. What the above means in plain language is, if the date on this row is not an exact match to a blank (denoted by ""), then execute the choose function, else just show a blank (the "" at the end). This should get rid of the error message by outputting a blank if the field is blank.

Hope this helps!

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.