Why developers should go to Dreamforce, and how you should prepare.

by Patrick Connelly posted on August 08, 2014

With Dreamforce just around the corner, it seems appropriate to do my list of reasons why developers should go to this conference. Over the past couple of years, Salesforce has really stepped up their game in bringing more to the conference for developers. So, why should you go to Dreamforce (or why should you send your developers)?

Intro to Apex: Auto converting leads in a trigger

by Patrick Connelly posted on July 23, 2014

Over the past couple of weeks I have seen several posts on the developer forums about writing a trigger to auto convert leads based on some criteria. Since this seems to be a pretty common topic, I thought I’d turn it into my first “Intro to Apex” blog post. In this post I am going to introduce a trigger that converts a lead and the test for this trigger. I am going then break down each line of the trigger and explain what it does and why it is there.

NOTE: This is a very basic trigger. If this were to be used in an environment where there was more than just this functionality in the trigger, I would classify this trigger to control the order of operations.

Using Git with Salesforce and distributed teams

by Patrick Connelly posted on July 21, 2014


I’ve been asked several times (and have presented a couple of times) on how our team handles doing Continuous Integration (CI) and Continuous Deployment (CD) with a distributed team. However one of the points that I’m always asked is specifically how we use Software Configuration Management (SCM) with this processes. For this blog post I’m going to do a deep dive into our process.

NOTE: This process is by no means the end-all-be-all process for everyone. This is just what we have come up with (generalized for public consumption) over several years of developing on the Force.com platform

The best feature in Salesforce Summer '14

by Patrick Connelly posted on June 26, 2014

Ok, so it might not be the BEST feature ever, but it is a feature after my own heart.

If you’ve ever done anything with pricebooks, you know how painful they can be. And worst of all how you cannot create a Pricebook2 entry in a test. This means that you have to pull a Pricebook2 from your orgs data which means you have to enable the dreaded SeeAllData.

Snapshotting objects in Salesforce with apex

by Patrick Connelly posted on May 20, 2014

A common issue that we have is a need to see information about Cases when it is created. We do this to do some analysis about how a case changes (primarily to verify how good our automated tools are working). To achieve this, we made a generic snapshot object that will store a JSON version of our data. We chose JSON for it’s portability and it’s ability to dump into other systems.

The Object

To start out we’ll need a place to put this data, so we created the object with the following fields. Download object.

  • JSON_Data_{0-9}__cRequired – These are several LongTextAreas that stores json data
  • Object_Name__cRequired – This is the name of the object that was snapshotted
  • NameRequired – An auto number, just used for identification
  • Case__cOptional – This is used for our case specific snapshot to link a snapshot back to a specific case

Board games that all board gamers should own

by Patrick Connelly posted on February 17, 2014

Now I know this is a bit out of the realm of “normalcy” for my blog, but I think there is a bit of overlap in people who would read this, and people who play board games. This list was generated by several suggestions of board gaming friends of mine. It is by no way 100% accurate or complete. We tried to get at least two suggestions per category and from there you can decide.

If we missed your favorite board game, or you think one doesn’t belong, let me know in the comments. And, feel free to buy me any board game I missed to convince me about it.

Sending pushover messages via Electric Imp

by Patrick Connelly posted on January 02, 2014

I recently got an Electric Imp april board and developer card. I’m really digging it and am planning on making a monitoring solution for my garage (including doors and freezer temps). In addition to reporting the data back via the agent, I wanted to add the ability to send a pushover notification to my phone on events. I wrote a quick method to do this, and thought it might be useful to others.

//Agent code
function send_pushover(title, message, priority) {
    local url = "https://api.pushover.net/1/messages.json";
    local token = "XXX_TOKENGOESHERE_XXX";
    local user = "XXX_USERGOESHERE_XXX";
    local headers = { "Content-Type": "application/x-www-form-urlencoded" };
    local data = {
        "token": token,
        "user": user,
        "message": message
        "title": title,
        "priority": priority
    local body = http.urlencode(data);
    local response = http.post(url, headers, body).sendsync();

//To use, send_pushover("My title", "My message", 0)
//For more on priority see https://pushover.net/api#priority

Adding git status to the bash prompt

by Patrick Connelly posted on October 24, 2013

After talking to a friend of mine Jeff Larkin about bash prompts, I decided to modify what he did into a single line bash prompt. By adding the following to your .bashrc you’ll get the branch your on in git (if current directory is tracked), a color denoting the status of the branch as well as the return code of the last command (if non-zero)

Even better remote notifications with Irssi

by Patrick Connelly posted on July 26, 2013

Last month I wrote a Irssi plugin that pushed messages from Irssi to Beanstalkd. I was pretty happy with it, but I wanted more. So, I’ve improved it. The new version pushes in a slightly more normalized json payload to one of two beanstalk tubes. The tubes are configured for here and away. Then the python script that consumes them either displays it via a notification pop up, if sent to the here tube, or to pushover if sent to the away tube.

Deleting all scheduled jobs in Salesforce with CasperJs

by Patrick Connelly posted on July 26, 2013


In a previous post, I talked about how to log in to Salesforce with CasperJs. At the time I did not have a good example of what to do next with it. Well, this week I had a need that is something that other people can relate to.