Visual Force
Dependent picklists in Salesforce
Mar 23rd
Virtually every site I’ve worked with in recent years has had need for dependent drop downs of some nature.
Usually implementing a dependent drop down consists one of two options: Outputting every option into a JavaScript method, or invoking an Ajax call to get the next set of options. The disadvantage to both of these options is usually a bulky mechanism the developer must write in order to provide a simple UI component.
Salesforce provides a dependent picklist feature, which in keeping with their no-software mantra, eliminates any need for a custom ajax or javascript solution. Define a dependent picklist and reference it in your page layout or Visualforce page. Salesforce takes care of everything else under the covers.
Easy Tool for Generic HTTP Interface Testing
Jan 26th
Working on my first CloudCraze project, I’ve come across the unfortunate fact that SF does not allow callouts in the unit tests, so interface testing is kind of cludgy (see ShippingAndHandlingFedExServiceTest.cls for example of what I mean). I know one solution would be to use the Run Anonymous functionality to test a small chunk of code, but I really wanted a very easy non-SF specific way just to quickly test requests and responses rapidly.
There may exist tools for this as there are for testing SOAP calls, but I couldn’t find any generic ones readily. That in mind, I whipped up a simple HTML applet to do this. It’s nothing fancy; it takes as input an endpoint URL and the request query string, makes an AJAX POST, and returns whatever response was given from the service. More >
Template for Global Configuration Variables in Apex
Nov 26th

Richard Vanhook
Summary: This article discusses a pattern or template for enabling and customizing features in an application developed upon the Force.com platform.
Force.com and “configurability”: new expecations for developers
A great thing about developing on the Force.com platform is how configurable the product is out of the box. Need a new field on a screen? Easy, find the right page layout and modify it. Want a field to be required? Go find the field and make it required. It’s crazy easy. So easy in fact, that more and more folks can contribute to the solution of a system. Even folks without an IT background that 5-10 years ago would never make these types of configuration changes are doing it. Can you imagine Joe the BA adding an Oracle constraint to make a field required? Of course not.
The downside to this amazing “configurability” of the Force.com platform however, is it creates a disconnect between developers who are not used to including this level of configurability, and salesforce users who have grown to love this type of configuration and now expect it in anything associated with salesforce. Below I discuss a “global configuration variable” pattern that makes adding configurability to your solution simple, clean and reliable.
VisualForce HTML5 Template
Oct 25th

Richard Vanhook
Below is the simplest VisualForce page I’ve been able to construct that renders valid html5 markup (per http://html5.validator.nu). Controlling the exact output rendered by a VF page is tricky business; especially so for generating doctypes. The trick here is getting the page attributes right, using apex:outputText unescaped, and returning the doctype via a binding. I don’t think it matters from a validation perspective but a space unfortunately precedes the doctype declaration. If anyone know of an even simpler way to do this, please share! More >
Error Notifications in Apex
Oct 25th

Richard Vanhook
When an error occurs in any language or platform, it’s important to know (1) an issue even occurred and then (2) as much context regarding the error as possible. Curiously though, I’ve observed that most folks doing Apex development don’t build into their solution any error reporting. That’s a pretty big oversight in my opinion and in order to hopefully make it easier, I’ve attempted to create a really simple mechanism for reporting an error in Apex.
Custom look-and-feel with Force.com Sites and Blueprint CSS
Mar 15th
At the core of Force.com Sites is an extremely simple, yet powerful concept: the ability to address a set of related Visualforce pages with a publicly accessible URL. Anyone with a web browser can access your application’s Visualforce pages, which in turn can incorporate a completely custom look-and-feel.
The sky is the limit…but where do you begin? Most developers investigating the Force.com platform will have a background in programming rather than visual design, and may be intimidated when building a UI from scratch.
Faster VisualForce Translation
Feb 14th

Richard Vanhook
I’m generally not a Microsoft fan but the one tool I can’t live without is Excel. Sure Google has a spreadsheet app but it’s nowhere near as powerful as Excel, like not even in the same ballpark. As a Force.com developer, Excel is especially helpful in taking a VisualForce page which contains hard-coded text labels and converting those labels to use “Custom Labels”, a Force.com feature similar to J2EE Resource Bundles which enables a VisualForce page to be translated.
In this article, I’ll show you how to leverage Excel to more quickly translate a VisualForce page.
