Part 2: Maconomy Hidden Helper - Background Task for Automatic Time Sheet Submission
As we reviewed in part one of this blog post series, Maconomy’s background tasks can perform repetitive or scheduled actions, which a user would typically perform manually. In this blog post, we will look at a background task that automatically submits all created, but not submitted time sheets on Friday night, ready for approval by our supervisors on Monday morning.
Step 1: Define a key generator
As a reminder, the key generator provides the data set for the schedule rule. In this example, it provides the list of time sheets which have not been submitted, and passes the key fields required for the submit action to the schedule rule. We will give it a name – best practice is not to use spaces or special characters – in this case, UnSubTime sheets.
The container is Time sheets. (Tip: you can check the container name in the single dialog “database relations” if you are unsure). Maconomy will automatically populate the key fields that will be extracted: EmployeeNumber and PeriodStart.
Next, include a condition that will get the values that we want, not all time sheets. Here, we can use “not submitted”. Test to make sure the key generator will work, using the Test Key Generation action.
Step 2: Create the schedule rule
As always, a Name and a Description, with the usual best practise regarding spaces and characters. For this example, SubmitTime sheets. Then, choose the type of rule – in this case “single task”. There are other options, which we will look at in the future blog post.
Now, choose the container to act on, and which pane we are referring to (Filter: the search bar, Card: the main part, or Table: the lower element with rows). In this example, we are affecting the Card part of the Time sheets container: the time sheet header.
The Action we wish the background task to perform on the time sheet header is the SubmitTime sheet action.
(Tip: If you don’t know the name of the action , export the “Standard” layout from the single dialog “Window Layouts” for the container you are looking at, and at the bottom of the layout file will be the list of standard (non-customised) actions available in that container. Then, select from the standard actions (create, update, delete or print) if you are using the task to update a value, or remove outdated information.)
Step 3: Assign the key generator to the schedule rule
Under the ‘Container Selection’ heading, map the fields brought from the key generator to the keyfields in the container. In this example, the fields easily map, as they are the same.
Step 4: Assign a time pattern and activate the rule
The time pattern uses a specific 5-section cron format, where the first entry represents minutes past the hour, the second hours, then days of the month, months of the year, and days of the week. In this example, the rule will generate a background task to perform the operation at 55 minutes past the 23rd hour of the day, on the 5th day of the week– so 11:55pm every Friday (server time).
Of course, given the nature of this action, there is a chance that the action will fail on some time sheets. Perhaps the user did not enter a minimum number of hours, or did not include tasks on a line. It is possible to build a more complex background task, which can mitigate these issues (e.g., which would submit after adding a line to any time sheet on a missing time task, which would equal the missing value). In this example, the results (similar to an error log from a failed import) will be stored for the system admin or other user to review and handle those time sheets not be submitted automatically.
In our next blog post in this series, we will look at a more complex background task intended to perform actions in more than one container to achieve the desired Deltek Maconomy outcome: transferring all approved vendor invoices to a new vendor invoice journal, and posting them.
Ready to Get Started?
For assistance with more complex configurations, talk to your Account Manager about an engagement with Deltek Global Consulting.