salesforce interview questions and answers 2

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)
16. How can you call a controller method from java script ?
Ans: Use action function component to call controller method from java script.
17. How can you call a visualforce page from a controller method?
Ans: Use pagereference object for calling a visualforce page from controller method
18. How can you sort a select SOQl query ?
Ans: use order by clause in select query for sorting a list of records
19. How much code coverage is needed for deployment?
Ans : Each trigger should have minimum of 1%. Class can have 0%. But, the total code covergae of 75%.
20. Can 'set' store duplicate values in it?
Ans : No. Set only stores unique values. List can have duplicate values in it.
21. Can two users have same profiles?
Ans: Yes
22. How can you refresh a particular section of a  visualforce page?
Ans: This can be done using reRender attribute 
23. How can you create a many to many relationship in salesforce
Ans: This can be done by creating junction object between the two objects.
24. What happens to detail record when a master record is deleted?
Ans: detail record gets deleted.
25. What happens to child record when a parent record is deleted(look up relationship)?
Ans. Child record remains undeleted 
26. How to get current logged in users id in apex ?
Ans: Use Userinfo.getuserid() to get the current logged in user's id in apex.
27. How to convert a csv file  browsed in visualforce page into a string.
Ans: use csvfilecontents.tostring(). method to convert blob to string
28.How many records can a select query return ?
Ans : As of now it can return upto 50000 records.
29. How many records can a sosl query return ?
Ans: as of now it can return upto 2000 records
30. How to fire dynamic query in soql?
Ans: Using database.query
     Example: List<account> accList = Database.query('select name from account');
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