One of the things about working for a company that innovates at such an incredible pace is that you are constantly tasked with keeping current on the latest release. Last night, as I curled up into bed, I did what any good technologist would do: I popped open my laptop, and brought up the pdf containing the Winter '10 release notes (I'm trying to save trees after all!).
trigger alertAEonCEOEmails on EmailMessage (after insert) {
for(EmailMessage message : trigger.new)
{
//blogware – if this was real, we wouldn't hardcode the email here
if(message.FromAddress == 'ceo@mybigdealthisquarter.com')
{
Account theAccountSO = getAccountByCEOEmail(message.FromAddress);
Task callTheCEO = new Task();
callTheCEO.OwnerId = theAccountSO.OwnerId;
callTheCEO.Subject = 'CEO Emailed';
callTheCEO.Description = 'You Better call him back;
callTheCEO.ReminderDateTime = System.now();
callTheCEO.AccountId = theAccountSO.id;
}
}
}