Skip to content

Instantly share code, notes, and snippets.

Avatar

Ralph Callaway ralphcallaway

View GitHub Profile
@ralphcallaway
ralphcallaway / AccountView.cls.java
Created Nov 21, 2012
Massive Internal View State (file extensions changed to assist with language auto-detection) See http://salesforce.stackexchange.com/questions/4537/how-to-reduce-a-large-internal-view-state-what-is-in-the-internal-view-state for related discussion
View AccountView.cls.java
/* NB: Class has been edited for brevity and may not compile initially */
public with sharing class AccountView {
// Input Properties
public String filter1 { get; set; }
public String grouping1 { get; set; }
public String grouping2 { get; set; }
// Select Lists
@ralphcallaway
ralphcallaway / snippet.cls
Created Nov 9, 2012
Example of good exception handling for vf pages
View snippet.cls
public void functionWithDML() {
try {
insert listOfStuff;
} catch(DMLException e1) {
// do nothing here, page messages are automatically generated
} catch(Exception e2) {
// uh-oh, something else happened bad, better show it to the user
ApexPages.addMessage(
new ApexPages.Message(
ApexPages.Severity.ERROR
@ralphcallaway
ralphcallaway / jQuery.component
Created Nov 9, 2012
Salesforce component for adding jQuery to a visualforce page
View jQuery.component
<apex:component >
<apex:attribute name="version"
type="String"
required="false"
description="Version of jquery. Defaults to 1.8.2. See https://developers.google.com/speed/libraries/devguide#jquery for a full list of available versions"
default="1.8.2"/>
<apex:attribute name="minified"
type="Boolean"
required="false"
You can’t perform that action at this time.