Skip to content

Instantly share code, notes, and snippets.

@ohadios
ohadios / ObjectQuery.vfp
Created March 5, 2017 15:21
ObjectQuery.vfp
<apex:page controller="ObjectQueryController" showHeader="true">
<apex:form >
<apex:pageBlock title="Query Objects">
<apex:pageBlockSection columns="1" title="Object Selection">
<apex:selectList title="" size="1" value="{!selectedObject}" >
<apex:selectOptions value="{!objectNames}"/>
<apex:actionSupport event="onchange" reRender="fieldSelection"/>
<apex:outputLabel >Select the object you would like to query</apex:outputLabel>
</apex:selectList>
</apex:pageBlockSection>
@ohadios
ohadios / ObjectQuery.vfp
Last active July 12, 2017 21:53
ObjectQuery
<apex:page controller="ObjectQueryController" showHeader="true">
<apex:form >
<apex:pageBlock title="Query Objects">
<apex:pageBlockSection columns="1" title="Object Selection">
<apex:selectList title="" size="1" value="{!selectedObject}" >
<apex:selectOptions value="{!objectNames}"/>
<apex:actionSupport event="onchange" reRender="fieldSelection"/>
<apex:outputLabel >Select the object you would like to query</apex:outputLabel>
</apex:selectList>
</apex:pageBlockSection>
@ohadios
ohadios / ContactQuery.vfp
Created December 13, 2016 03:24
Webinar 11 - VisualForce
<apex:page controller="ContactQueryController" showHeader="true">
<apex:form >
<apex:pageBlock title="Query Objects">
<apex:pageBlockSection columns="1">
<apex:selectList title="" size="1" value="{!selectedObject}" >
<apex:selectOptions value="{!objectNames}"/>
<apex:actionSupport event="onchange" reRender="fieldSelection"/>
<apex:outputLabel >Select the object you would like to query</apex:outputLabel>
</apex:selectList>
</apex:pageBlockSection>
@ohadios
ohadios / Arguments
Last active October 14, 2016 01:19
Arguments
String myStr = stringUtil.toAlternate('THis is a test');
system.debug(myStr);
String typeName;
typeName = stringUtil.returnTypeName(date.today());
System.Debug(typeName);
typeName = stringUtil.returnTypeName('I do words');
System.Debug(typeName);
@isTest (seeAllData = true)
public class SOQLqueries {
static testMethod void SOQLandCollections(){
//This only works when this test Class is set to SeeAllData=True!
List<Account> accts = [SELECT ID FROM Account];
System.debug(accts.size());
System.debug(accts);
//System.debug(accts[0].Name);//This won't work because Name was not acquired in the query.
accts = [SELECT ID, Name, Phone, BillingState FROM Account];