You are on page 1of 6

SOQL QUERY

 SOQL stands for Salesforce object Query language


 It receives data from database using SELECT keyword
 It return Records
SOQL Query for Standard Object
 Select Name, Phone from Account where Name=‘SFDC Computing’
 Select Name, AccountId, Account. Name, Account. Industry from Contact
 Select Id, Name, (Select Id, Name from Contacts) from Account
SOQL Query for Custom Object
 Select Id, Name, Email__c from Student__c
 Select Name, College__c, College__r. Name from Student__c
 Select Id, Name, (Select Id, Name from Student__c) from College__c
SOSL QUERY

 SOSL stands for Salesforce object search language


 It receives data from database using FIND keyword
 It return Fields
SOSL Query
Find SFDC in all Fields Returning Account (Name),
Contact (LastName)
Find SFDC in all Fields Returning Account (Name, Industry where
Industry=‘Consulting’)
DATATYPE IN APEX

 Boolean - A value that is assigned true, false or null.


 Date - A value that indicates a particular day.
 Datetime - A value that indicates a particular date and time.
 Integer - A 32 bit no. without decimal point.
 Double - A 64 bit no. with a decimal point.
 Long - A 64 bit no. without decimal point.
 String - Set of characters within single quote.
 Id - valid 18 character lighting platform record identifier.
APEX CLASS

In Apex we can define Outer class as well as Inner Class.


A class is a template or blueprint to create the objects.
Example to create Apex class
public class NewAccount {
public Account createAccount (Stringname)
Account acc = new Account();
Acc.name = name;
return acc; } }
ACCESS MODIFIERS

 Private
In this modifier the method or variable is accessible only within the
apex class in which it is defined
 Protected
In this modifier the method or variable is visible to any inner classes in the
defining apex class.
 Public
In this modifier the class is accessible to the organization.
 Global
In this modifier the method or variable can be used by any apex code
that has access to the class.
QUESTIONS

1. Total no. of SOQL query issued


2. Total no. of SOSL query issued
3. For Delete event which is used trigger.new or trigger. old
4. Trigger.old is available on which Events
5. Trigger.new is available on which Events

You might also like