Skip to main content

Posts

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 https://success.salesforce.com/answers?id=90630000000grVPAAY 2) Consider a scenario I have not given any CRUD...
Recent posts
Interview Questions Q: What is the data type of Trigger.New? - Trigger.New is of Data Type List (A collection of records). Q: What is the difference between Trigger.New and Trigger.Map? - Trigger.New returns a ordered list of records but Trigger.Map returns a map(Key value pair). Q: What is the difference between User Context and System Context? /What is the difference between running in user Mode or system Mode? - In User Context/Mode the execution of class/method takes place considering the logged in users          Permission (Sharing rules, OWD, field level security...)   In System Context/Mode none of the permissions associated with the logged in user is considered.        The execution takes place as though the user has full fledged rights on everything. Q: Explain the key words With Sharing and Without Sharing. - Consider  a Custom Object  'MarksDetail' has OWD security set to 'Private',    Now l...
Q: i have to send a mail after every 2 days. how do i implement this? A: Yes, Time dependent Workflow Q: Can i pass ID in before insert/update trigger A: Passing ID in before insert is not possible because there is no record still created.    In before updated we can pass ID Q: What is sharing rule and the least restrictive sharing rule A: Sharing rule must be less restrictive than the ORganization Default Sharing rule.    OWDs are the baseline security for your Salesforce instance. OWD are used to restirct access. you  grant access through other means like sharing rules, role hierarchy, manual sharing,    So Sharing rules should not be more restrictive than OWD Q:Passing parameter from VF page to controller class <apex:param assignedTo> Q:Passing parameter from VF page to other VF class  - through URL  - Mapobj = ApexPages.currentPage().getParameters();  - PageReferenceObject.getParameters().put('En',EmployeeN...

Interview Questions on: Calling Methods from Javascript and Controller

Q 1> Calling controller method using Javascript in VF page Solution: - ActionFunction (http://www.cloudforce4u.com/2013/06/actionfunction-in-apex.html) - Using JavaScript remoting Q 2> Different ways to call Apex methods from VF page Solution: a. There are components using "action" keyword like mentioned below, They can call apex methods from VF page - <apex:Page>  Refer Example 3 - <apex: commandbutton> Refer Example 4 - <apex :commandLink> Refer Example 5 b. Also AJax methods like mentioned below can call apex methods from VF page - actionSupport Refer Example 6 and (http://www.cloudforce4u.com/2013/06/difference-between-action-support-and.html) - ActionFunction (fRom javascript) Refer Example 7 c. Also using Getter methods we can call Apex methods from VF page Refer Example 8 - Having a getter methods in controller and caling that method name in the VF page component Example 3: VF Page: <apex:pa...
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 ...
Difference between Sandbox and Developer Edition a) Using the Sandbx  we can copy the configurations and/or data from live instance/Production instance directly to Sandbox. But In Developer edition we cannot copy anything  from production/salesforce.com instance. Every thing should be manually done by the user. b) If we purchase Unlimited Edition, then Sandboax is included in the cost  but If we purchase Enterprise,professional or Group editions then we have to seprately pay for Sandbox. But Developer edition is free of cost. Any one can start using developer edition free of cost c) Reason why do we have Sandbox and Developer edition? Sandbox is created so that we can have a instance which is exactly like production on which we can test and implement our changes and then move it production. But Developer Edition is more like development of integration and apps, specifically for the AppExchange and a great place to learn/test/train users in salesforce....
When do we use '!' symbol  in visualforce page. Let understand this clearly with a small example. Consider the 'Rendered' property in Visualforce page. This property is used when we have  to display/hide a field on the visualforce page. And how we do that? Like this: <apex:form Rendered="True"> The above line means that the specific form should be displayed when the value is True. This is more like hardcoding and this remains same unless we change it to "false". Now lets say we have a criteria where user decides if the form should be displayed or not which would mean we cannot gauge what user would choose at the run time. Hence we would need some mechanism where we can get the value dynamically, How do we do that? Like this: <apex:form Rendered="{!checkStatusValue}"> So Which means that when we have to fetch a Variables value in the run time/dynamically we use '!' in front of the variable in visualforce