Code for Cookies

Photo by D Sharon PruittI’m not above bribery.

Earlier this month I had a really pressing need for a count of all Activities related to a given Opportunity.  My goal was to use this count as part of a calculation for prioritizing Opportunities.

Well, it turns out, us button-click-admins can’t do that kind of thing within Setup.  You have to be able to code a trigger.  Boo!

So, I put my thinking hat on.  What motivates coders?  Food!  Specifically baked goods!

I posted this in the Salesforce Community on 8/3/10:

I would like to have a field on Opportunities (for now, Cases later) that is a count of Activities.  I know this isn’t possible via the UI, but I’m hoping some generous coder out there will take pity on me and share the appropriate code.
I’m happy to bribe you with baked goods if that will help.  🙂



Ten short days later my plea was heard by Kevin Swiggum.  He wrote a fantastic blog post with the helpfully commented code, enlightening commentary and, best of all, the triggers are bulkified!  Swoon!

And all for the love of chocolate chip cookies!


4 Responses to Code for Cookies

  1. Pingback: Packing list for Dreamforce ’10 « Amber Neill – Salesforce Administrator

  2. Brandy says:

    Oh no way!!! I am so stoked to hear this! I need that too. I am totally going to bring him some cookies at DF10 also. Nice blog, btw, this is my first visit.

  3. Pingback: 2010 in review « Amber Neill – Salesforce Administrator

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: