Skip to content

Instantly share code, notes, and snippets.

View suddeb's full-sized avatar

Sudipta Deb suddeb

View GitHub Profile
@suddeb
suddeb / DynamicSOQLPractice
Last active October 3, 2016 00:12
DynamicSOQLPractice
public with sharing class DynamicSOQLPractice {
public static void getAccountFieldsDynamically(){
String allFields = '';
List<Account> allAccounts;
Map<String, Schema.SObjectField> fieldMap = Schema.SObjectType.Account.fields.getMap();
for(Schema.SObjectField singleField : fieldMap.values()){
allFields = allFields + ',' + singleField.getDescribe().getName();
}
//queryString is the String containing the actual SOQL statement
List<sObject> allData = Database.query(queryString);
@suddeb
suddeb / Mapbox_3
Last active August 29, 2015 14:27
<apex:page Controller="HouseHoldController" showChat="false" sidebar="false" showHeader="false">
<head>
<title>Leaflet Draw</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.2.0/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.2.0/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
@suddeb
suddeb / Mapbox_2
Last active August 29, 2015 14:27
<apex:page showHeader="true" standardStylesheets="false" sidebar="false">
<html>
<head>
<meta charset="urf-8"/>
<title> First Mapbox Map</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=mo' />
<script src='https://api.mapbox.com/mapbox.js/v2.2.1/mapbox.js'></script>
<link href='https://api.mapbox.com/mapbox.js/v2.2.1/mapbox.css' rel='stylesheet' />
@suddeb
suddeb / Mapbox_1
Last active August 29, 2015 14:27
<apex:page showHeader="true" standardStylesheets="false" sidebar="false">
<html>
<head>
<meta charset="urf-8"/>
<title> First Mapbox Map</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=mo' />
<script src='https://api.mapbox.com/mapbox.js/v2.2.1/mapbox.js'></script>
<link href='https://api.mapbox.com/mapbox.js/v2.2.1/mapbox.css' rel='stylesheet' />
<apex:page controller="SingleController">
<apex:pageBlock>
Welcome {!name}
</apex:pageBlock>
</apex:page>
<apex:page controller="SingleController">
<apex:form>
<apex:pageBlock>
<apex:pageBlockSection columns="2">
<apex:outputText value="Enter your name"></apex:outputText>
<apex:inputText id="nameId" value="{!name}"/>
</apex:pageBlockSection>
<apex:pageBlockSection columns="2">
<apex:commandButton id="buttonId1" action="{!goToSecondPage}" value="Enter"/>
</apex:pageBlockSection>
public class SingleController {
public String name {
get;
set{
name = value;
System.Debug(LoggingLevel.INFO,'Inside setter Name: ' + value);
}
}
public PageReference goToSecondPage(){
public class AccountTriggerHandler {
//After Insert Handler
public class AccountAfterInsertHandler implements MyTriggers.Handler{
public void handle(){
System.Debug(LoggingLevel.INFO,'Inside AccountAfterInsertHandler');
}
}
//Before Insert Handler
public class AccountBeforeInsertHandler implements MyTriggers.Handler{
public class AccountTriggerHandler {
//After Insert Handler
public class AccountAfterInsertHandler implements MyTriggers.Handler{
public void handle(){
System.Debug(LoggingLevel.INFO,'Inside AccountAfterInsertHandler');
}
}
//Before Insert Handler
public class AccountBeforeInsertHandler implements MyTriggers.Handler{