Skip to main content

SFDC scenario based interview Questions

1) Consider this scenario
I  have a profile  by name 'ProvideReadAccess' and two users U1 and U2 assigned to it. And I have object X.
My Question is I want to have ReadWrite access for U1 and ReadOnly access for U2  for the object X.
How do I do this?

Answer:
Read Access for both users is common hence in the Profile settings give 'Read' access for the object 'X'
By doing this User U2 will be able to read all the records( One condition satisfied) but U1 will also be able to only read the records(Second condition not satisfied).

So next what do we do is we create a permission set say 'GrantWriteAccess' and in this permission set we give the object 'X' the Write access and assign the user U1 to this permission set.(2nd condition satisfied).

Explanation about when and where to use permission set and profile


2) Consider a scenario
I have not given any CRUD permission in the profile 'P1' for an object O1, yet I'm able to create records for object 'O1'. How could this be possible?

Answer:  Any permission with respect to creation /deletion/Updating/viewing of object is possible only through permission set or Profile.
Meaning If we are able to create records in a object then the Create Permission in either Profile or in Permission Set should be enables. If its not enabled in the Profile then it has be in the Permission set.

So check for the permission set.

3)Consider a scenario

I have two un related objects Obj1 and Obj2. Now I want to create a Master Detail relation between these objects how do I do this?
One tow
Answer: First  choose which object has to be a Parent object(Master) and Child Object(Detail).
For our understanding lets say for now we decide Obj1 to be Master object and Obj2 to Detail object.

First lets under stand what's a Master Detail relation ? Every child should have  a parent. Which means every record in Obj2 should have a related parent record in Obj1. Also One child can have only one parent. But One parent can have multiple children.

Scenario 1: if there are pre existing records in the Obj2 then?
With the above understanding on Master Detail relation we have to be sure that every record in Obj2 has a related record in Obj1.
And in our scenario Obj1 and Obj2 are not related to each other. So first we have to create a basic Look up relation between these two objects so that we can establish a relation between these two objects.
So we follow below steps
 1st we create a Lookup field in the Child Object Obj2 pointing to Obj1 as parent.
2nd Update the Lookup field of all the records in Obj2 with a  value from the Obj1 (Related field)
3rd Then we convert the Look up field to Master Detail relation.


Scenario2: If there are no pre existing records in the Obj2 then?


4)Consider a scenario
I'm trying to implement Pagination. Initially i want to dispaly 50 records and when user click on Next button, the records stating from 51 to 100 should get displayed. How do I accomplish this.

Answer: The key question here is how do we fetch next 50 records when user clicks on 'Next'?
                   One possible way to implement this is to have 'OFFSet' used in SOQL which fetches the records.
                   Eg:   SELECT Name from Merchandise__c 
                            where Price__c > 5
                            Order by Name Limit  100
                             OFFSET 50

5) I have 2 workflow Rules and two Fields F1 and F2
When ever F1 is updated to value= 10,  WF1 fires and updates F1 value to 20 and F2  value to 30
When ever F1 values=  20 there is another Workflow W2 fires which will update F1 to 10 and F2 to 20
What will be the outcome of this Workflow rule.


Answer: This scenario will cause  recursive Workflow rule
                   This will exhaust the governor limit and result in error

6)I have a User, Who will leave the organization tomorrow. He is basically a manager and there are 15 users below him.
Now when this user leaves the organization i would generally inactivate the User.
But now my concern is if I inactivate this user What happens to the Role hierarchy? the assignment rules, Approval processes, the records created by him and records to which he is the default owner like leads and cases. And what would be best possible solution to keep this application intact and running and yet have this user de activated?

Answer: To prevent users from logging into your organization while you perform the steps to deactivate them, you can freeze user accounts. [Spring Summer 14]
So in this way untill you find ways to remove this User from Role hierarchy/assigenment rules/update the Owner of the records created by him / from any place where this user is used, we can make use of FREEZE button on the USer record.
Note:
1. When we click on FREEZE button, the user will not be able to login  to the application any more.
2. Freezing user accounts doesn't frees the user licenses available for use in your organization. We have to      de activate the user to free the license.

7) I want to delete 20000 records and I dont want them to be recovered from recycle bin.
OR
I want to do a mass delete on set of records and dont what them getting into recycle bin.
What possible options do I have?

- Yes this is possible, Use Hard Delete Option

8)Let say I have a page which displays the set of records from Account object and I'm using a standard controller.  Now I have two users belonging to same Profile. When they login and view this page, they get  a message "Insufficient privileges". What could be the reason for this? Or who would u arrive at a solution?
- Notice below points:
- Question speaks about standard Object and Standard Controller.
 - Also remember permission to a object is given by Profile.
So we need to check if the user has pemssion to read data of this Object.
Only if the permission is given to the user,he'll be able at access them else he will get an error message as "Insufficient privileges"


9)I have Stadard Controller and Controller Extension. You can write all that logic in Controller Extension which can be written in Custom Controller. Also both Controller Extenstion and Custom controller execute in System Mode. So Why do we need Custom Controller ?
Answer:
 1st point Controller Extension cant exist on its own. It has to be implemented on a Standard Controller or a custom controller.
So keeping the above point in mind, Lets say certain methods needs to be executed in User Mode and certain in System Mode. In this scenario it makes absolute sense to User Standard Controller with Custom Extenstion. Where in using  Standard Controller provides all pre existing features of Force.com platform.
But note that When we use Standard Controller All the Sharing rules, permissions of a user are respected.
So if this what we wanted then we should go for an implementaiton of this sort.

Other wise if we are building all features on own like Save Edit Update and delete then we should be using Custom Controller.

10)Let say I have a page which displays the set of records from Account object and I'm using a standard controller.  Now I have two users belonging to same Profile. When they login and view this page, they get  a message "Insufficient privileges". What could be the reason for this? Or who would u arrive at a solution?
- Notice below points:
- Question speaks about standard Object and Standard Controller.
 - Also remember permission to a object is given by Profile.
So we need to check if the user has permission to read data of this Object.
Only if the permission is given to the user,he'll be able at access them else he will get an error message as "Insufficient privileges"

11) Have you ever faced this error message "API is not enabled for this Organization or Partner" and how do you overcome this?

Solution:

Error message: "API is not enabled for this Organization or Partner"

What does it mean-  This error messages indicates that you're trying to do an API call and you don't have API enabled for that particular profile for which the user is mapped to.



How to fix this:

1. Firstly verify the Edition you are working on: Enterprise, Unlimited and Developer editions has the API enabled by default. For other editions this feature needs to be purchased.
2. Next verify the Profile of the User. Access the profile settings in order to verify that API feature is enabled or not
 Steps:
            a. Click Setup | Administration Setup | Manage Users | Profiles.
            b. Select the profile next click on --> System Permissions --> search for "API Enabled" --> Check the check box.

Please refer the below link for reference.

Comments

  1. good questions.. very helpful. can I have more like that please...
    Email :ripanrocky2002@gmail.com

    ReplyDelete
    Replies
    1. Hi Ripan,
      Sure will try my best to provide few more...

      Delete
    2. I am a fresher looking for job in salesforce, if is there any job then plz let me know

      Delete
  2. Replies
    1. u posted a useful information..thanks for posting.. send mesome more scenarios to my gmail..chinnabunny11@gmail.com

      Delete
  3. Really Wonderful scenarios you have shared here, indeed helpful!!

    ReplyDelete
    Replies
    1. Rashmi,
      I'm happy that it was helpful for you!!!

      Delete
    2. If u have more scenario questions please share to me raghu007elex3@gmail.com

      Delete
  4. Really usefull.can u send me more to ashoknayak2216@gmail.com

    ReplyDelete
  5. Really usefull.can u send me more to ashoknayak2216@gmail.com

    ReplyDelete
  6. Very useful post... Cld u send more questions to jayabalaji.tkm@gmail.com

    ReplyDelete
  7. Please can u send more question on aman.rajshekhar28@gmail.com

    ReplyDelete
  8. Please can u send more question on aman.rajshekhar28@gmail.com

    ReplyDelete
  9. Very helpful content. Thanks Nagu :)
    Please provide some more scenario based questions.

    ReplyDelete
  10. Very Useful ques.....it'd be great if you could send some more.
    My email ID- sunnyhbtik@gmail.com

    ReplyDelete
  11. Could you please share more questions @ rahul78.bansal@gmail.com

    ReplyDelete
  12. Its very good. Can you please share more questions raghuveer38@gmail.com

    ReplyDelete
  13. Please send me more suresh.balasundaram@hotmail.com

    Thanks!

    ReplyDelete
  14. Please send me more suresh.balasundaram@hotmail.com

    Thanks!

    ReplyDelete
  15. please send me more gsatishsfdc@gmail.com

    Thanks!

    ReplyDelete
  16. Good questions..Thank you!!
    Will be more helpful if you could sent some more on my mail(subho.deo@gmail.com)

    ReplyDelete
  17. Can you Sharre more questions at pranotib9@gmail.com

    ReplyDelete
  18. can you please share some more questions to me : deep.singhal2310@gmail.com

    ReplyDelete
  19. I would request you to please mail me some senario based question of SF.
    Email - archit6660@gmail.com

    ReplyDelete
  20. I would request you to share more scenarios to dvishat@yahoo.com please?

    ReplyDelete
  21. This comment has been removed by the author.

    ReplyDelete
  22. Can you Share more questions at suresh.tavva88@gmail.com

    ReplyDelete
  23. very helpful post could you please send some more questions like this in sharma.shambhavi1988@gmail.com

    ReplyDelete
  24. Thanks for uploaded useful data to us...i hope you will update more questions soon.Please share updated scenario based questions to my id sairam.sfdc4@gmail.com

    ReplyDelete
  25. Good questions..Thank you!!
    Will be more helpful if you could sent some more on my mail(ajeet.kushwaha14@gmail.com)

    ReplyDelete
  26. hello nagu thanks for this scenarios.... its really helpful for me
    can you lease forward me few more scenarios at m mail (itsalrightk@gmai.com) i ill be thankful for you

    ReplyDelete
  27. hello nagu thanks for this scenarios.... its really helpful for me
    can you lease forward me few more scenarios at m mail (itsalrightk@gmai.com) i ill be thankful for you

    ReplyDelete
  28. these r very helpful to me but I want more scenarios.... because prepare for interviews

    ReplyDelete
  29. HI Nagu, Thanks for sharing the scenarios. Could you please forward me some more scenario questions (@ jaikrishna85@gmail.com). Thanks for your help

    ReplyDelete
  30. Hi,

    very helpful, I am preparing for salesforce administrator job please share some more scenarios and interiew questions(@ haripriya3034@gmail.com)

    Thanks,

    ReplyDelete
  31. Hi Nagu
    Its really useful post. I am trying for Salesforce admin job. so if u have other scenarios please email to selvithamil@gmail.com

    Thanks in Advance.

    ReplyDelete
  32. very helpful, I am preparing for salesforce job .please share some more scenarios and interview questions(vishnu3p@gmail.com)

    Thanks,
    Vishnu

    ReplyDelete
  33. Hi Nagu,
    Thank you for various scenarios.can i get more scenarios and interview ques please.
    Thank you once again

    ReplyDelete
  34. Very nice and helpfull post....if you have more question could you please send me on my email id - harshitgarg2591@gmail.com.

    thanks,
    Harshit Garg

    ReplyDelete
  35. Very nice and helpfull to me can you please send more scenarios to my mail mahendra4443@gmail.com

    ReplyDelete
  36. Do you suppose to have any other scenario based real time questions related to admin like the ones posted above.

    ReplyDelete
  37. Nice Post. Can I have more Plz. If u can? My Email : abjadhav5@gmail.com

    ReplyDelete
  38. So nice. All questions and its answers are very useful to deal with real life scenarios. please send me more questions like this on giteshsonavane@gmail.com

    ReplyDelete
  39. Nice Blog. Could you please send me more question like above on prtkkabra@gmail.com

    ReplyDelete
  40. Nicely put. Could you please send me more question like above on ashwini760@gmail.com

    ReplyDelete
  41. Could you please send me more question like above sonal.gupta141289@gmail.com

    ReplyDelete
  42. for first question if i give owd public readonly

    ReplyDelete
  43. Dear, this post is really good..please share more such questions or links where such scenario based questions and answers can be read at satvinder78@gmail.com

    ReplyDelete
  44. Hi Nagu,

    Amazing work :) i am sharing my mail id(piyalik35@gmail.com), you could add me to your hangout. I wish you keep up the good work also we can discuss about more challenging topics in salesforce.

    Regards,
    Piyali

    ReplyDelete
  45. Hi Nagu, This post is really helpful.please share more such questions or links where such scenario based questions and answers can be read at awasthi.madhuri27@gmail.com.
    Thanks
    Madhuri

    ReplyDelete
  46. Wonderful post...please update with more scenaio....

    ReplyDelete
  47. its very useful stuff i need more such questions with answers am sharing my mail id rreddy8705@gmail.com
    thanks in advance....

    ReplyDelete
  48. Excellent. Do you have more such questions?

    ReplyDelete
  49. Can u share more scenario questions to sagar.phadtare93@gmail.com

    ReplyDelete
  50. This is very helpful , please send more questions to gouravmaggu10@gmail.com if someone is having.

    ReplyDelete
  51. This is very helpful , please send more questions to chendukancharla@gmail.com

    ReplyDelete
  52. These questions are very helpful. Could you please send some more questions to me on jain.v.2911@gmail.com

    ReplyDelete
  53. Thank you for sharing helpful questions.Could you please send more questions on mostwal27@gmail.com.

    ReplyDelete
  54. Please send more scenarios on this email. rajasekharreddy90100@gmail.com

    Thanks in advance

    ReplyDelete
  55. Really good question pleas send more questions to me - ayubgbu190@gmail.com

    ReplyDelete
  56. very helpful, I am preparing for salesforce job .please share some more scenarios and interview questions(ankitshmw00@gmail.com)

    Thanks,
    Ankit

    ReplyDelete

Post a Comment

Popular posts from this blog

Interview Question on Triggers 1) What the are events of triggers? - After insert,After Update & After Delete 2) Upsert trigger can call which all events? -After Update & After Insert 3) What is merge operation? 4) Which events will be called during merger operation? - Ans Delete n Update 5) In After Undelete, we cannot see trigger.old, only trigger.new can be seen.True or False?        -TRUE 6) Static variable declarion in trigger is possible,True or false?      -TRUE but it will not work. 7) In After update trigger event to Save a record do we need DML statement? - Yes 8) In before insert trigger event can we have trigger.new and trigger.newmap? - we can only have trigger.new, Trigger.newmap is not possible because still the record is not inserted             and record Id is not generated. 9) Can we have batch/asynchronous method called from a Trigger? - YES 10) Can we ...

Custom Labels

Can we have multiple values in Custom Labels. Yes, Salesforce supports multiple values in custom Labels. How to implement that ? Create a New custom label and provide Multiple values with comma ( , ) separated. Example:   Custom Label Name: School Values: Test,Exam,Tutions How to access this Custom Label in Apex controller / Class file Syntax: System.Lable.CustomLabelName Example:System.Label.School How to access this Custom Label in Visualforce page Syntax: !$Label.CustomLabelName Example: !$Label.School How do we check if TempString is present in the custom label in a controller ? Syntax: System.Label.CustomLabelName.Contains(value) Example: System.Label.School.contains(TempString) How do we check if TempString is present in the custom label in a visualforcepage? Syntax: CONTAINS($Label.CustomLabelName,TextValue) Example: CONTAINS($Label.School,"Text")