Time Worked creation for past Weeks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2013 10:46 AM
I can not figure out how to add time to a timecard for a day in the past? Not everyone remembers to log all of their time on the day they do the work. How do you let people go back to enter their time for a past week?
I don't see how to do it without modifying their core table structure and scripts around time_worked. I have tried adding a field for "Date Time worked" and then adjusted the BR "Update Time Card" to the new field instead of sys_created_on, but it is still not working. Does anyone have any ideas?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2013 10:38 AM
I see what you mean!
Task Time Worked isn't actually related to Time Card. It's only related to a task and a user.
The related list is only possible by the defined Relation called "Time Worked", whose relation is defined with a script:
var start = parent.week_starts_on.getGlideObject();
var end = new GlideDateTime(start);
end.addDays(7);
current.addQuery("task", parent.task);
current.addQuery("user", parent.user);
current.addQuery("sys_created_on", ">", start);
current.addQuery("sys_created_on", "<", end);
So, as you say, this ties the task_time_worked to the time_card based on sys_created_on.
I suggest adding a new field to your task_time_worked called date_performed, that you can edit.
Then update the Relation script to use your new field instead of "sys_created_on".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2013 06:38 AM
Thanks Geoff. I had tried that prior to posting the content and it did not work. I couldn't find any other business rules or scripts that would be effecting how this works.
Any other ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2013 07:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2013 08:08 AM
I was changing the query script in the business rule "Update Time Card" and not in the Relationship table. Once I changed it there it worked perfectly!!