This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Developer: Ralph Callaway <ralph@callawaycloudconsulting.com> | |
Description: Helper methods for dynamic DML | |
*/ | |
public class DynamicDMLHelper { | |
public static Object recursiveGet(sObject record, String field) { | |
if(field.contains('.')) { | |
Integer firstPeriod = field.indexOf('.'); | |
String nextObjectName = field.subString(0, firstPeriod); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:form > | |
<apex:pageBlock id="cp_module" rendered="{!detailKey = 'cp'}" title="Client Preferences" mode="edit"> | |
<apex:pageblockButtons location="top"> | |
<apex:commandButton value="Edit" rendered="{!NOT(clientPreferencesModification)}" | |
rerender="cp_module" status="LoadingStatusSpinner"> | |
<apex:param assignTo="{!clientPreferencesModification}" value="true"/> | |
</apex:commandButton> | |
<apex:commandButton value="Save" rendered="{!clientPreferencesModification}" | |
action="{!saveClientPreferences}" status="LoadingStatusSpinner" | |
rerender="cp_module, im_counts"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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" |
NewerOlder