AJAX S-Control for creating opportunites from contact
In Salesforce.com, you can create an Opportunity by clicking the “New” button on the Contact’s Opportunity related list. You are taken to a blank Opportunity form, and when you save it a Contact Role is set for that Contact. There are a few suboptimal things about the process:
- I have to pick the correct record type
- We have multiple Opportunity record types, so I have to go in and select Gift each time I create a new Opportunity
- The Opportunity name is blank
- We have a standard naming convention for Opportunities. Steve Andersen 2005 Donation is how a gift from me would look. We have to type that in every time we create a new Opportunity
- The Contact Role is blank when the Opportunity is created
- We use Contact Roles for acknowledgement on the gift. If I make a donation, I’m set as the Donor role. When we report, we can total up all the Opportunities on which a Contact was a Donor, and that’s their total giving. We have other Roles, like Soft Credit, that we use for thanking folks, but not giving the same credit as Donor. Because the system sets the Role to blank, I have to go in and change that after I save the Opportunity.
So, I created an S-Control and installed it as a Custom Link on the Contact page layout. When I want to create a new Opportunity, I click that Custom Link. An Opportunity is created with the correct name based on my naming convention, and the Contact Role is set correctly. I land on the edit page for this new Opportunity, and I can change anything that I need to.
There are no custom fields necessary to use this S-Control, all you have to do is change the record type id in the S-Control code to match the id you want to use for gifts. Install the S-Control in a similar fashion to what I showed in the earlier walk-through, but create a new Custom Link under Customize | Contact instead of a Web Tab. Whiz-bang easy…

January 10th, 2006 at 1:37 pm
[...] To make this easy to use, there probably needs to be some custom code for creating Opportunities and automatically relating them to the right donor and Household. I’ve written part of this, and I’ll augment it to support the Household portion as soon as I can. Then I’ll tackle the non-trivial concept of thanking individuals vs. thanking Households, and the best way to do that. [...]