This section applies your knowledge of Apex’s outbound email features to enhance the Services Manager sample application. Many scenarios in Services Manager could benefit from email notifications. For example, consultants have requested that they get an email when a timecard is approved or rejected by their project managers.
To implement this change, add a trigger on the
after update event of the Timecard object. If the new value of the Timecard’s
Status field is
Rejected, query the Contact record that created the Timecard. Send an email notification of the change to the Contact.
Listing 5.41 is a sample implementation. It begins by checking to make sure that the updated Timecard contains ...