Posts

Showing posts from 2015

Interview Questions - 6

1. What is difference between PAGEBLOCK TABLE and a DATA TABLE? A: <apex:pageBlockTable> : A list of data displayed as a table within either an <apex:pageBlock> or <apex:pageBlockSection> component, similar to a related list or list view in a standard Salesforce page. <apex:dataTable> : It will also display the data as a table, but look and feel will be different. 2. Can we make a field mandatory in a Visualforce Page? A: Yes, we can make the field required by using the "Required" attribute. 3. What is Batch Apex? When we go for the batch Apex? A: Batch Apex is used to build complex, long-running processes on the force.com platform. We can go for the batch apex when we face any Governor Limits. 4. What is Pagination? A:  Pagination is the getting Previous and Next Links to move into previous and next pages. 5. How can we avoid the Governor Limitations? A: By using Batch Apex. 6. What is Developer Console or Anonymous Block? A: An an

Interview Question - 5

1. What is Master Detail relationship and look up relationship in Salesforce? A: Master Detail relationship is the Parent child relationship. In which Master represents Parent and detail represents Child. If Parent is deleted then Child also gets deleted. Rollup summary fields can only be created on Master records which will calculate the SUM, AVG, MIN of the Child records. Look up relationship is something like “has-a” (Containership) relationship. Where one record has reference to other records. When one record is deleted then there is no impact on other records. 2. Can we convert the lookup relationship to Master Detail relationship? A: We can convert the lookup relationship to master detail relationship if and only if all the existing record has valid lookup field. 3. Can we create Master Detail relationship on existing records? A:No. As discussed above, first we have to create the lookup relationship then populate the value on all existing record and then convert it. 4.

Map Scenario

Image
Scenario:  Create field dependency using vf page public class MapEaxmple {     public Map<String, Account>  accMap{set;get;}     public List<SelectOption> sp{set;get;}     public Account accs{set;get;}     public String selected{set;get;}     public String result{set;get;}     public MapEaxmple(){         accMap=new Map<String, Account>();         sp=new List<SelectOption>();         Account a1=new Account(name='emilyn', phone='903030');         Account a2=new Account(name='aabbcc', phone='78576');         accMap.put('First', a1);         accMap.put('Sec', a2);         Set<String> keys=accMap.keySet();         for(String s:keys){             SelectOption sop=new SelectOption(s,s);             sp.add(sop);         }     }     public void data(){         accs=accMap.get(selected);       }      } <apex:page controller="MapEaxmple">     <ap

Interview Questions - 4

1. What is call out and what is call in? A: Making requests to external system from salesforce is callout.      Getting requests from external system is call in.     example of setting a custom timeout for HTTP callouts:         HttpRequest req = new HttpRequest();         req.setTimeout(2000); // timeout in milliseconds  2. How many ways we can schedule Batches?Is it possible to schedule with external tool like data loader? A: We can schedule batches using dataloader.    We can use Schedulable interface to schedule batches    Yes, We can schedule the data loader using CommandLine Interface. 3. Is there any limitations to use @future? A: @future: future annotation to identify methods that are executed asynchronously.    Yes,the following are @future limitations.    1. No more than 10 method calls per Apex invocation    2. No more than 200 method calls per Salesforce license per 24 hours    3. The parameters specified must be primitive dataypes, arrays of primitiv

Interview Questions -3

1.What is the salesforce architecture? Ans: Salesforce architecture is the multitenancy architecture. Multitenancy refers to a standard in software architecture where a single instance of the software runs on a server, serving multiple client organizations (tenants). 2.How many types of controllers? Ans: 3 Types Controllers are available in Salesforce. 3.What are the types of controllers? Ans: 1.Standard Controller   2. Custom Controller  3.Controller Extension 4.Write apex class scenario? Ans: public with sharing/without sharing  class classname          {        Declaring Variables, Get, Set Properties;        Declaring Methods;           } 5.Write trigger scenario? Ans: Trigger Triggername on sObjectName(Events)          {        // Statements;         } 6.How many ways we can import data into salesforce? Ans: we can import the data into Salesforce using import wizard, Apex Data Loader. 7.What is the default modifier? Ans: wh

SandBox

1.What is sandbox? A.Sandbox is the exact copy of Production's metadata with some data or without data. 2.What are different types of sandboxes? A.Developer,Developer Pro,Partial-Copy and Full copy sandbox. 3.What type of sandbox you worked with? A. General Question and answer    Full Copy Sandbox 4.What is Developer Sandbox? A.Mainly this type is used for developing purposes along with unit testing. 5.What is Developer Pro Sandbox? A.Mainly this type is used to club the developers program and integrating purposes along with testing and data loading. 6.What is Partial copy Sandbox? A.All types of testing except load testing and performance testing. 7.What is Full copy Sandbox? A.All types of testing include load testing and performance testing. 8.In Which sandboxes we will have same copy production? A.Full copy sandboxes. 9.In which sandbox we will have same record ID like production? A.Testing Sandbox/ Full copy. 10.For which Edition we will have sandb

Email Scenario

Image
Send an Email from Apex using Visualforce page public class sendEmail {     public String subject{get;set;}     public String body{get;set;}     public String text{set;get;}     public String text1{set;get;}     public List <String> ToAddresses{get;set;}     public List<String> CcAddresses{set;get;}     public sendEmail()     {         ToAddresses = new List <String>();         //Add your custom logic to extract email of contact          CcAddresses = new  List<String>();     }   public PageReference send(){         // Define the email         Messaging.SingleEmailMessage email = new                           Messaging.SingleEmailMessage();         ToAddresses.add(text);         CcAddresses.add(text1);                                 // Sets the paramaters of the email         email.setSubject( subject );         email.setToAddresses( ToAddresses );                  email.setCcAddresses( CcAddresses);

Schema Scenarios

Scenario -1

Schema Scenario -1

Image
Create a picklist field in the vf page with list of all the subjects in your org and  when you select the  subject corresponding description of the object should be displayed  Apex:   public class VfExampleSchema {     public Map<String, Schema.SObjectType> sobt{set;get;}     public List<SelectOption> opts{set;get;}     public String selected{set;get;}     public String result{set;get;}     public VfExampleSchema(){         sobt=schema.getGlobalDescribe();         opts=new List<SelectOption>();         Set<String> keys=sobt.keySet();         for(String s:keys){             SelectOption sp=new SelectOption(s,s);             opts.add(sp);         }     }     public void data(){         Schema.SobjectType sot=sobt.get(selected);         schema.DescribeSObjectResult reslt=sot.getDescribe();         result= '=====>>>'+reslt;     } } Vf Page: <apex:page controller="VfExampleSchema">     <apex:form >

List, Set and Map-2

14. What is Set?  A. Set: It is an unordered collection of similar elements where the memory size can grow or reduce dynamically based on  Dynamic requirement. Collection or Group of primitive/Non–primitive data types The elements in the set are not reserving insertion order. Syntax: Set<Datatype> setname; 15.What is the internel datastructure? A. Set<primitive/non-primitive type>  setinstance = new set<primitive/non-primitive type> (); 16. Will Set allow the duplicates? A: No, Set will not accept duplicate values. 17. Will the set maintain insertion Order? A:  No, the elements in the Set are not reserving insertion order. 18. How the elements in the set are referred? A: Set Key Word 19. What is the use of contains(ele), ContainsAll(ele)? A: Contains (ele): This method will check whether the given element is in the set.          If it is in the set then returns true.         Set<Integer> ages=new Set<Integer>{12,22,33,44};        

List, Set and Map -1

1. What is an array? A. Array:  It is a collection of similar elements where the memory is allocated sequentially elements in the array are  referred using Index Value. Always the index value start with Zero.       Syntax: Datatype[] arrayName;                   String[] names;                   Integer[] ages;                   Decimal[] salary; 2. Elements in the are referred using? A. Elements in the array are referred using Index Value. Always the Index value start with zero. 3. What are the drawbacks of array?  A. An Array Notation of a list using [] can only be one dimensional. 4. What is a List?  A. List: List is an ordered collection of elements which will allow duplicates.     Syntax:     List<datatype> listName = new List<datatype>();     – The datatype allows both primitive datatypes and non-primitive datatypes     – Size of the list is dynamically increased.      List index starts from zero. 5.  Syntax of List? A: List<datatype> li

Triggers

1.What is an workflow? A:Workflow Rules are automated process to send E-mails alerts,        assign tasks, update fields on trigger criteria based requirements. 2.When will the Workflows invoke? A: Workflows are invoked        When ever the given W/F criteria is met during the DML operations(Insert (or) update) on   particular object  3. What is a trigger? A:Triggers are the automated actions when ever any DML operation is performed on particular object 4.What are the differences between Workflow and triggers? A:   Triggers Workflows       1. You can perform all DML operatios 1. You can perform only update operation, you cannot perform insert , (insert,update,delete,undelete)   delete and undelete operations         2. You can perform any logic on any 2.You can perform update operation on  object in entire organization  only that particular object and corresponding child object 5.What are the Triggers Events? A: There are seven tri

Visualforce Scenario-1

Image
The following visualforce code will automatically prompts to the "My Contacts" once we click on Contacts tab. Override the following Visual force page with the Contacts tab <apex:page tabStyle="Contact">     <script>     window.onload=function(){         parent.document.location.href="/003?fcf=00B28000003Qk7B";     }     </script> </apex:page>

Interview Questions - 2

1. Can we convert the lookup relationship to Master detail relationship? A: Yes, we can convert the lookup relationship to master detail relationship if and only if all the existing record has valid lookup field. 2. In how many ways we can invoke the Apex class? A: 1. Visualforce Page        2. Trigger        3. Web Services       4. Email Services  3. Can we create Master Detail relationship on existing records? A: No, first we have to create the lookup relationship then populate the value on all existing record and then we have to convert it. 4. What is the Difference in render, reRender and renderas attribute of visualforce? A: render: It works like "display" property of CSS. Used to show or hide element. reRender: If we want to refresh partial page in visualforce page we have to use reRender. renderAs: By using this we can convert entire visualforce into PDFand doc. The Syntax is Render as ="pdf" Note: If you want to convert into Excel or Ms-word u