SFDC interview questions and answers 13

Part 1 (1-15) - Part 2 (16 -30) - Part 3 (31 -45) - Part 4 (46 -55) - Part 5 (56 -66) - Part 6 (67 - 78) - Part 7 (79 - 90) - Part 8 (91 - 100) - Part 9 (101- 111) - Part 10 (112 - 120) - Part 11 (121 - 130) - Part 12 (131 - 137) - Part 13(138 - 145) - Part 14 (146 - 152) - Part 15 ( 153 - 159)- Part 16 ( 160 - 168) Part 19 (188 - 201)

138. What is @future annotation in apex?
Ans - It is used to indicate that code should be executed asynchronously when salesforce has available resources.


139. What are the different considerations that must be followed when using @future annotation in apex method?
Ans - 1. Method must be static 2. It must return void and 3. method can have argument of type primitives,collection of primitives or arrays of primitives
 


140. How can you execute batch apex programmatically?
Ans - Batch apex can be invokde using Database.executebatch(). Ex- Id batchprocessId = Database.executebatch(mybatchapexclass,200)

141. How can you set the batch size in batch apex ?
Ans - This can be set using optional scope parameter in database.executebatch (batchapexname,batchsize) example - Id batchprocessId = Database.executebatch (mybatchapexclass,200) in this example batch size is set to 200


142. How can you monitor batch apex job?
Ans - Batch apex job can be monitored by navigating to your name --> setup --> monitoring --> Apex jobs

143. What is the difference between List type custom setting and Hierarchy type custom setting?
Ans - List type stores static data that can be used in apex code as it is examples could be country codes,currencies etc
          Hierarchy type stores data that may change depending on user,profile or org wide default


144. Where can custom setting data be accessed?
Ans - Custom setting data can be accessed in formula fields,validation rules,workflow rules,apex,API
145. What different return types can be returned by SOQL?
Ans - A SOQL can return List of objects, a single object or an integer
 


Part 1 (1-15) - Part 2 (16 -30) - Part 3 (31 -45) - Part 4 (46 -55) - Part 5 (56 -66) - Part 6 (67 - 78) - Part 7 (79 - 90) - Part 8 (91 - 100) - Part 9 (101- 111) - Part 10 (112 - 120) - Part 11 (121 - 130) - Part 12 (131 - 137) - Part 13(138 - 145) - Part 14 (146 - 152) - Part 15 ( 153 - 159)- Part 16 ( 160 - 168) Part 19 (188 - 201)

No comments:

Post a Comment