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
accounts = [Select ID, Name, BillingState From Account | |
Where BillingState IN ('CA','NY','FL')]; | |
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:page controller="RemotingObjectsController"> | |
<script> | |
/* Declare Javascript Function | |
function Account(){ | |
this.Id = null; | |
this.Name = null; | |
} | |
var acc1 = new Account(); | |
acc1.Name = 'Texas'; |
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 with sharing class RemotingObjectsController { | |
@RemoteAction | |
public static void addAccounts(List<Account> accounts){ | |
insert accounts; | |
} | |
} |
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 class DataUtils { | |
//pass object name and Id to get all fields for sObject record | |
public static sObject getObject(string objName, string id) { | |
String fieldnames = ''; | |
sObject obj; | |
try { | |
Map < String, Schema.SObjectType > m = Schema.getGlobalDescribe(); | |
Schema.SObjectType s = m.get(objName); | |
Schema.DescribeSObjectResult r = s.getDescribe(); |
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
pageParams = ApexPages.CurrentPage().getParameters(); | |
string theId; | |
if (pageParams.containsKey('id')) { | |
theId = pageParams.get('id'); | |
} else { | |
return null; | |
} | |
//now go look up the account using getObject method |
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 class MyClass() | |
{ | |
MyClass c = new MyClass(); | |
List<MyClasss> myList = new List<MyClass>(); | |
myList.add(c); | |
} |
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
private Integer cost; | |
public Integer getcost() { return cost; } | |
public void setcost(Integer cost) { this.cost=cost; } | |
// Variable as Property | |
public Integer cost { get { return cost; } set { this.cost= cost;}} | |
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
//Declaring and using Interface | |
public interface myInterface { | |
void doSomething (String thing); | |
} | |
public class MyClass implements MyInterface { | |
public void doSomething(String x); |
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
// SubClass with Method Override | |
public virtual class myParentClass { | |
public virtual void dosomething() | |
{ | |
System.Debug('Something'); | |
} |
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
TYPEOF What | |
WHEN Account THEN Phone, NumberOfEmployees | |
WHEN Opportunity THEN Amount, CloseDate | |
WHEN Campaign THEN ExpectedRevenue, StartDate | |
ELSE Name | |
END | |
FROM Event |
OlderNewer