Skip to content

Instantly share code, notes, and snippets.

View fractastical's full-sized avatar

Joel Dietz fractastical

View GitHub Profile
try {
queryString += ' where Start_Date_Time__c > ';
startDate = String.escapeSingleQuotes(startDate); //Protection against SOQL Injection
String[] s = startDate.split('/');
for (Integer i=0;i < s.size();i++)
if (s[i].length()==1)
s[i] = '0' + s[i];
queryString += s[2] + '-' + s[0] + '-' + s[1] + 'T00:00:00Z';
whereUsed=true;
public with sharing class EnhancedLookupController extends EnhancedComponentController {
String secondDisplayColumn;
public String displayColumn { get; set; }
public String objectToLookup { get; set; }
public String displayName { get; set; }
public String filterString { get; set; }
public transient List<JsonObject> jsonObjs { get; set; }
public Boolean bigset { get; set; }
//MOD of example in http://www.tgerm.com/2010/02/visualforce-salesforce-jquery-ajax-how.html by d3developer (d3developer.com)
<apex:page showHeader="true" standardStylesheets="true" >
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"
type="text/JavaScript" />
<script
string s = '0013000000K7WW2';
2.try{
3. ID sID = s;
4. // if we get here, it's a valid ID and the sID field is an 18 character one
5.} catch (System.StringException e){
6. // if it goes here, it's not an ID. Do something if you need to.
7.}
<apex:dataList value="{!accounts}" var="account" id="theList">
<apex:outputText value="{!account.name}"/>
</apex:dataList>
<apex:dataTable value="{!accounts}" var="account" id="theTable">
<apex:facet name="caption">table caption</apex:facet>
<apex:facet name="header">table header</apex:facet>
<apex:facet name="footer">table footer</apex:facet>
<apex:column>
<apex:facet name="header">Name</apex:facet>
<apex:facet name="footer">column footer</apex:facet>
<apex:outputText value="{!account.name}"/>
</apex:column>
<apex:column>
<apex:enhancedList type="Account" height="300" rowsPerPage="10" id="AccountList" />
/*
reid.carlberg@salesforce.com
creates entities required for testing.
*/
public with sharing class TestUtility {
/*
A random user is useful for testing in order to be
sure that you are able to see data across posts regardless
public class popup {
public boolean displayPopup {get; set;}
public void closePopup() {
displayPopup = false;
}
public void showPopup() {
displayPopup = true;
<apex:page controller="popup">
<apex:form >
<apex:commandButton value="Show Pop up" action="{!showPopup}" rerender="popup"/>
<apex:pageBlock >
Lorem ipsum ..... dummy stuff to show the popup is above content
</apex:pageBlock>
<apex:outputPanel id="popup">
<apex:outputPanel styleClass="customPopup" layout="block" rendered="{!displayPopUp}">
Lorem ipsum <br/><br/><br/>