Simple Timer & Timecard System for Salesforce
We’d like to build a small timer and timecard system so that salesforce.com users can easily track time spent working on record-related tasks.
The timer interface will be a simple inline Visualforce page that can be included in any page layout and consist of a Start/Stop button and a text field for comments.
The application will consist of two custom objects: Timcard and Timer. The Timer object will have a mster-detail relationship to the Timecard. A Timecard will hold the multiple timer records started for a single day.
Create the Timecard object with the following fields (feel free to add/modify based upon your design):
User (lookup to User the timecard is for)
Date (the date of the timecard)
Hours (rollup summary of hours in of the related timer records)
Comments (long text)
Submitted (checkbox - defaults to false)
Create the Timer object with the following fields (feel free to add/modify based upon your design):
Timecard (master-detail to Timecard)
Start Time (datetime - the start time of the timer)
End Time (datetime - the end time of the timer)
Hours (the total elapsed time for this timer based upon start and end)
Comments (long text)
Account (lookup to Account)
Contact (lookup to Contact)
Case (lookup to Case)
Opportunity (lookup to Opporutnity)
SomeCustomObject1 (lookup to SomeCustomObject1)
SomeCustomObject2 (lookup to SomeCustomObject2)
Create a inline Visualforce page
When the user clicks the Stop button, write the end time into the record, calculate the total time spent and allow the user to enter any text into the comments field. Remove any indicator (text, image or color change) from the Visualforce page. (If you have a better way to accomplish the timer task then please implement it.)
Other requirements include:
1. A user can only have 1 currently running timer at any time. If they try start another timer for a different record they will receive an error notification and a link to the page of the currently running timer so that they can stop it.
2. If the user has worked on a particular record for that day already, display that record on the Visualforce page (start time, stop time, hours) and allow them to start a new timer.
3. The page layout with a running timer will always show the current elapsed time. If the user refreshes the page it will display the elapses time from the server and start counting so that it always displays the elapsed time.
4. Create a tab for Timecards so that users can use standard salesforce.com functionality to edit Timecard and Timer records.
Users can only work X number of hours per day. Create a numeric field on the User object for “Max Possible Hours to Work”. This number could be different for each user. Create a nightly scheduled task that looks at all running timers, and if the total time is more then that user’s “Max Possible Hours to Work”, stop the timer and set the Hours equal to the value in “Max Possible Hours to Work”.
Must have adequate test coverage (90%+).
Upload all your source code as a zip (you can simply zip up your Eclipse project for convenience) and provide any documentation and/or instructions that are needed. Please be clear and concise with any setup instructions.
An SWF/Youtube video of your application is required as well as an unmanaged package
or ANT script for installation.
Your submission will be judged by a panel of peers based upon this criteria. If you
would like to request an extension, please read Can challenge deadlines be extended for more time? on our FAQ. We do not want to grant extensions
unless there is a valid reason.
The discussion board is closed for this challenge.