Skip to main content

Posts

Showing posts from May, 2014
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 ...