Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Trigger Practice :

1)What is Trigger
-Trigger helps to call a specific peice of code when something happens in salesforce.
Apex Trigger enables us to perform custom actions before and after events to record in
Salesforce

2)What is event in trigger


- In trigger we have to decide when trigger gets fire thats why we use event in trigger so its
will decide when trigger gets fired
There are main two events like before and after in this there are seven main type
1)Before Insert
2)Before update
3)Before Delete
4)After Insert
5)After Update
6)After Delete
7)After Undelete

3)WHat is before events / What are events in Trigger


- When due to any record trigger gets fired and we want work on that record specifically
then we use before event.

4)WHat is after events


- When due to any record trigger gets fired and you dont want to work on that record but
wants work on some other record at that time we use after event.

5)What are contex variable in trigger


- Contex variables are special types of variables which are managed by salesforce itself and
they gives us better control over trigger funtionality.
-There are 12 types of contex variable .
1)isExecuting()
2)isInsert()
3)isUpdate()
4)isDelete()
5)isBefore()
6)isAfter()
7)isUndelete()
8)New()
9)newMap()
10)old()
11)oldMap()
12)Size()

Trigger.New - When due to any records trigger gets fired then the latest version of that
record will inside trigger.new.
Trigger.newMap - When due to any reocord trigger gets fired Then the map of Id's to the
new version of the records will be inside Trigger.newMap
InValue - along side with Id entire record will be there.

Trigger.old - when due to any records trigger gets fired then the immdite previous version
of that record will be inside trigger.old.

Trigger.oldMap - When due to any records trigger gets fired then the map of ID's to the old
version of the records will be inside Trigger.oldMap.

6) What do you mean by recursion of trigger


- When any specific trigger is running again and again in a loop for an infinite times it is
turn as recursion of trigger.
- For this we can create an another class in which we define an static boolean variable and
we can take its value as true and depending on a need we can use if else
situation as well and then we can call that variable inside the trigger.

7)What is mean by Bulkification


- It is a practice which we should follow so that our code will work fine wether we get one
record or 1000's of record at runtime.

8) Bullkyfication of trigger
-1) We must avoid using values like trigger.new[0] as we never know how many records we
may get at run time.
2) We need to use for each loop wether we have one record or many.
3) We must not use SOQL inside for Loop.
4) We must not use SOSL inside for Loop.
5) We must not use DML inside for Loop.
6) We need to store data in collections.

9) What is within sharing


- When we use with sharing our class will follow all the security protocol - Which we set at
profile and OWD level.

10) What is Without sharing


- when we use without sharing our class will not follow any security protocol.

11) What is Test class


- Whenever we write a code in salesforce we cant directly send to the production we need
to do a testing in the same way QA will do via writting some code this
is possible by using Test class.
12) Why we use Test.startTest() & Test.stopTest()
- To reset the governer limit.
Static Dashboard - A static dashboard is a dashboard that appears the same to all the
people viewing it.
Dynamic Dashboard - It allows each user to see the data they have access to according to
security settings that are in place.

SALES CLOUD - Its part of CRM and contain automation

Lead Management - Leads are our procpects which can become petential customer after
lead nurturing (care or Protect) and when we convert a lead then three seperate record will
be create automatically which are account, contact and opportunity is optional
Account Management - Accounts are companies with which we are willing to do bussiess.
Contact Management - Contacts are the persons associated with perticular account.
Opportunity Management - Opportunity are the deals which we will be getting from
accounts or company.
Case Management - Cases are like customer complaints which are needed to be resolved
ASAP - We have case assignment rule so that cases can be assign with perticular users
depending on some conditions. - We have case escallation rules as well by which if the
certain case is not attended or closed in a specified time period it will automatically will be
assign to a different user.

What is vf page?
- It is a web development language created by salesforce.com syntax for this language like
HTML. -
1) To work on complex pages
2) To display record from multiple object
3) To edit multiple record at the same time
4) When we want more than two columns display of data
What is partial DML
- When we want to perfom partial insertion then we can use database class like
Database.insert (Same for the update)

What is standard controller?


- When our VFP is dependent on any controller which is actually an object (standard or
custom) then that controller is called standard controller.

Batch Apex : This is used to run large jobs which contains millions of records.
Queue able Apex : These are also like future methods but has an ability to chain jobs with a
class.
Scheduled Apex : These are scheduled to run at a specific time

You might also like