Classifying Triggers in Salesforce

by Patrick Connelly posted on February 13, 2012

Anyone that has ever had multiple triggers on objects in Salesforce knows that it can be very painful to manage them. Because of the way Salesforce chooses to run the triggers your code can be run in a non-deterministic order. In addition to this, having to sort through multiple files to find the one piece of code you are looking to update can be painful.

To combat this, you can take your triggers and condense them down into a single trigger and a single class. Inside this class you would have a method containing each of your individual triggers.


Vim and Salesforce development

by Patrick Connelly posted on February 09, 2012

Since I switched over to using vim as my primary mode of Salesforce development, I’ve been asked several times how I’ve configured vim. Well, it’s about time I show the man behind the curtain. My primary vim config file is quite large now, but I’ve condensed it down to the parts that I think are most pertinent to Salesforce development.


Salesforce and soapUI — Testing WebServices directly

by Patrick Connelly posted on February 03, 2012

In a previous post I talked about writing webservices for Salesforce. In this post I’ll discuss how to test your webservice with soapUI without having to write any additional code.

Getting soapUI

You will need to install the Open Source version of soapUI from their sourceforge. Go ahead, I’ll wait…


Creating Web Services in Salesforce

by Patrick Connelly posted on January 06, 2012

This article has been updated to show lessons learned over the past three years. The content of this article is still relevant, but is a little out-dated.

Preface

At my current job, we have several external systems that interact with Salesforce, and they do so through web-services. This document will cover what I have learned in regards to web-services, caveats with them and common pitfalls.

Overview

The goal of our web-services is to provide a single point of entry for each major object represented in Salesforce. A major object would be Account, Case, Case Comment etc. The reason this is differentiated is that for instance, Case Groups would under the AccountAPI since they are a minor object. Each web-service consists of two parts. First the actual web-service class which holds the externally facing methods and from which the WSDL is generated. The second part is that of the util class which holds all of the logic and is reusable.


Using meld with git diff

by Patrick Connelly posted on May 03, 2011

This is test

Syncing saved games between Windows / Mac / Linux with Dropbox

by Patrick Connelly posted on May 20, 2010

So with steam coming out on the Mac and with the Humble Indie Bundle working on all three, there is a problem with keeping all of your saves in sync. Not any more. This is all thanks to dropbox.

What is dropbox?

Dropbox is a cross-platform application / website that keeps files in sync and gives you 2Gb of storage space for free. If you’re not a dropbox user already, you can sign up here.


Automatic backups with UDEV

by Patrick Connelly posted on September 25, 2009

I recently challenged myself to come up with a way to make udev automatically backup when you plug in a USB harddrive. I did all my testing with a USB stick drive, but since they both show up as block devices to the kernel, it shouldn’t matter.

UDEV Rules

To start with, we need to set up static naming for the storage device that you want to make into backup disk. Start by plugging in the disk. (Now I’m not using Gnome or KDE so I’m not sure what their automounter will do. So, you might have to find a way to exclude it from the automounter. We need to find out the “model” of the drive. My udev rules are pretty basic, and will work since most people don’t have more than one the same model of USB drive laying around that they would use. You can always modify the udev rules to work for you.


External programs that update screen

by Patrick Connelly posted on September 18, 2009

Screen is a great tool, and it allows you do to alot of neat things. One of my favorites is binding commands to key strokes. So all you have to do is hit F5 and it will start something in the background. Such as a build command. The problem is, you either get no output, or you get spam all over your screen. Well I’ve finally found a way around that. The answer lies in ANSI Privacy Messages.


irssi + mumbles == push notification goodness

by Patrick Connelly posted on August 31, 2009

One of the biggest problems with irssi is that if you run it on remote machine, it can be quite hard to get notifications. For the past couple of years, I’ve been running a plugin called fnotify that writes notifications to a file, then using another script I read that file and print it out with libnotify. There are a couple of problems with this:

  1. libnotify is ugly
  2. takes up diskspace if you don’t clear the queue
  3. requires you to either have the script, or remember the ridiculously long command

DVD player with xsessions

by Patrick Connelly posted on June 12, 2009

I’ve come across the need to simply the dvd playing process. I’m having to set up a laptop to play a dvd and use a remote presenter control. Now in the past I’ve just been in charge of this setup, and haven’t had to worry about explaining how to start it up for others. This time, I need to make it as user friendly as possible. So, I’ve decided to do this with a couple of bash scripts and a couple of xsessions.

Goals

  • Generic user with a generic password to hand to the person in charge
  • Ability to play dvd stored locally. (Called presentation_dvd)
  • Ability to play any dvd inserted.
  • Require no user input except to choose presentation_dvd or dvd