salesforce.com interview questions and answers 11

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)

121. Expand SOQL and SOSL.
Ans - SOQL- salesforce object query language, SOSL - salesforce object search language.

122. What is the difference between soql and sosl?
Ans - SOQL can query records from a single object at a time, while sosl can query records from multiple objects. SOQL returns a list while SOSL returns list of lists.

 
123. How can you query all records using an soql statement?
Ans - This can be done using ALL ROWS keyword. This queries all records including deleted records i recyclebin.

124. What is the use of @future annotation?
Ans - Using @future annotation with a method executes it whenever salesforce has resources available.

 

125. What are the different access modifiers that can be used with methods and variables?
Ans - Global, Public, private and protected

126.  What is the significance of static keyword?
Ans - Methods, variables when defined as static are initialised only once when class is loaded. Static variables are not transmitted as part of view state for a visualforce page.

 

127. Can custom setting be accessed in a test class?
Ans -  Custom setting data is not available default in a test class. We have to set seeAllData parameter true while definig a test class as below.
          @isTest(seeAlldata=true)

128. What is the difference between role and profile?
Ans - Role defines record level access while profile defines object level access.

 
129. On which objects can you create Queues?
Ans - Queues can be created on two standard objects (Lead and case) and also on all custom objects.
130. What are the different ways to invoke apex code?
Ans - Apex code can be invoked using DML operation(trigger), Apex class can be scheduled using schedulable interface(ex. batch apex), apex code can be run through developer console, an apex class can be associated with a visualforce page
.


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)

salesforce interview questions and answers 10

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)

112. Ho can you place an entire visualforce page in a different visualforce page?
Ans - This can be done using include attribute.

113. How can you hard delete records in apex?
Ans - use emptyrecyclebin method as below
    ex-  delete myAccList;
         DataBase.emptyRecycleBin(myAccList);


114. What all data types can a set store?
Ans - A set can store all primitive data types and sObjects but not collections.

115. What is the use of offset keyword in a soql query?
Ans - Using offset keyword return the records starting from desired location in the list. For example if we specify offset 8 then all the records starting from location 9 onwards would be returned.


116. How can you display an image as an field in a detail page of record?
Ans - This can be done using IMAGE function. A url of the image stored in document should be given in image function

117. When a lead is converted into account/contact will the trigger on account/contact fire?
Ans - In set up we can enable or disable whether triggers should run on conversion.


118. What happens to contacts when an account is deleted?
Ans - When an account is deleted all the contacts under it gets deleted.

119. What is an sObject type?
Ans - sObject refers to any object that can be stored i force.com platform database. ex. sObject s = new contact()


120. How many elements can be stored with in a collection(list,set,map)?
Ans - There is no limit on the number of elements that can be stored in a collection. However, we need to consider the heap size limit.


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)