Pages

Friday, July 22, 2011

VF Pages and Emails: Dynamic Copyright Date

"Thanks for getting that e-mail out so quickly... but the footer still says 2008!"

I hate hearing that and luckily there is an easy way around it.  I can't tell you how many email templates or VF pages I have in my SF instance that had hard-coded dates.  The most frequent culprit was a duplicated VF email template with a standard copyright footer. 

Rather than hardcode something like:
Copyright ©2005-2011 Acme, LLC. All Rights Reserved

You could specify a floating year like this:
Copyright ©2005-{!year(today())} Acme, LLC. All Rights Reserved