Workflow is great. I can simply and declaratively make changes, and can easily update things like email templates, criteria, tasks, etc. without using Eclipse and writing/running unit tests. Sometimes, however, workflow isn’t enough; we need to use a trigger. Today, I had a use-case that when a DateTime field is filled, a contact (identified via a lookup on a parent object – so a grandparent record) should receive a notification. That’s easy enough to do with a ISCHANGED(DateTimeField__c) workflow criteron, but the Email Alert can’t “find” the contact. A trigger is necessary. Here’s how I coded the trigger: I’ve left out a lot of parts here, but I hope that the main bit of using Trigger.oldMap to find the old value and compare it to the new one comes through. Happy coding!
Salesforce Administrators learn to remind users: “Search before you create a new lead.” Pretty simple, right? Duplicated records are a pain. Then why do I see some very accomplished Salesforce users in the Dreamforce app posting duplicate Content/Files in Chatter? Here are some examples from the Files tab: The better thing to do – assuming that you need to post the same file multiple times (this should be rare, as it might be considered Chatter Spamming, but when referring multiple users or groups to a document, it can come in handy) is to upload the file ONCE and use references to it in subsequent feed posts. This has a bonus: Better maintenance! Instead of other users not knowing which file to follow if they want to be notified anytime that file is updated, just ensure that there is only ONE copy in the org, and everyone can follow that. This […]