Sample Application: Missing Timecard Report

A common application of Batch Apex is to distill a large number of records down to a smaller, more digestible set of records that contain actionable information. In the Services Manager sample application, consultants enter timecards against assignments, specifying their daily hours for a weekly period. When consultants fail to enter their timecards in a timely manner, this can impact the business in many ways: Customers cannot be invoiced, and the budget of billable hours can be overrun without warning. With a large number of timecards, consultants, and projects, manually searching the database to identify missing timecards isn’t feasible. This information needs to be extracted from the raw data.

The management users of the Services Manager have requested a tool that enables them to proactively identify missing timecards. They would like to see a list of the time periods and the assignments that have no timecard so that they can work with the consultants to get their time reported. This information could later be used as the basis of a custom user interface, report or dashboard component, or automated email notifications to the consultants.

This section walks through the implementation of the missing timecard report. It consists of the following steps:

1. Create a custom object to store the list of missing timecards.

2. Develop a Batch Apex class to calculate the missing timecard information.

3. Run through a simple test case to make sure the code works as expected.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.243.4