SalesForce Interview questions


Total available count: 39
Subject - SalesForce
Subsubject - SalesForce

How to cover the code for a batch class?

To cover the code for the batch class we should call the batch class from the inside of the Test.startTest() and Test.stopTest().

Test.startTest();
??//You can write Call the batch class code start from here.
Test.stopTest();

Key Points:-
To write a Batch Apex class, your class must implement the Database. Batchable interface and include the below 3 methods: 
start() execute()
If your code accesses external objects and is used in batch Apex, use Iterable<sObject> instead of Database. QueryLocator.
The default batch size is 200 records.




Next 5 interview question(s)

1
Is it possible to call future method from a batch class?
2
Is it possible to call batch class from one more batch class?
3
How to schedule batch apex in minutes/hours?
4
What are the types of Collections available in Apex?
5
What is the difference between non-static and static?