In the previous post, we looked at using the standard (button-click) way to create a new child record using Publisher Actions. Pretty basic stuff. Using Visualforce to create a custom action is a bit harder. Let's start with the documentation. The PDF provided by clicking on the link in the Actions screen (Account action is […]
Create and Populate a Map<Id, Sobject> Without Loops
There are many reasons to use Maps in Apex triggers. Sometimes I want to make a List of Contacts, but I want to pull each one by its ID. This is a good reason to abandon the List and to make a
. (Some will prefer to use
, and that is okay too.) We […]
1 |
Map<id, Contact> |
1 |
Map<string, Contact> |
Workflow ISCHANGED() translated to Apex trigger
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 […]
Next Birthday Formula
How would you display your Contacts with upcoming birthdays? I’ve seen people use “Birthdays This Week,” “Birthdays This and Next Week,” and other reports to display the list. I’ve also seen requirements for showing a person’s next birthday, to trigger an automatic email to each Contact on his/her birthday. Let’s see how it’s done: [sourcecode […]
PageReference Best Practice
I've seen a lot of coders put the following into their custom Visualforce controllers:
I've decided that I don't like this approach. It feels too much like a URL hack, and though I'm sure that it will always work (meaning that salesforce.com will never change its way of referring to a record by
), […]
1 2 3 4 5 6 7 8 9 10 |
public PageReference customsave() { try{ insert acct; } catch (DMLException e) { /*do stuff here*/ } PageReference acctPage = new PageReference ('/' + acct.id}; acctPage.setRedirect(true); return acctPage; } |
1 |
/<recordID> |
- 1
- 2
- 3
- …
- 5
- Next Page »