Posts

Showing posts from July 30, 2017

Salesforce Q&A Part 7:

Apex Test  Q)Why use test class in salesforce? Ans.  Test class is important to check the sanity and sole purpose of custom apex code written for organization. Apex code having minimum 75% of test class coverage is considered healthy apex code.  Q)How will the salesforce compiler knows you are writing a test class? Ans.  Using @isTest annotation and static testmethod() are two things. Q)How to make the private variable and methods visible? Ans.  Using @testVisible annotation. Q)What are the lines present in main code that are ignored in test class. Ans.  System.debug statements. Q)How can we run the test class for particular user? Ans.  using system.runAs(userProfile/username) Q) How to test asynchronous apex? Ans.  Using Test.start?() and Test.stop(). Q) How do you write test class for web-service class? Ans. Define a mock test  class implementing WebserviceMock interface for SOAP. and  StaticResourceCalloutM...

Salesforce Q&A Part 6:

Visualforce Q&A: Q) Mention the components used by you in normal VF pages. Ans. The following components were used in my VF pages. <apex:page/> <apex:pageBlock/> <apex:pageBlockSection/> <apex:pageBlockTable/> <apex:repeat/> <apex:commandButton/> <apex:commandLink/> <apex:includeScript /> <apex:inputField. /> <apex:outputLabel/field/panel  /> etc. Q) Difference between PageTable and Data Table. Ans.  PageBlockTable DataTable It must be defined in pageblock/pageblocksection. Anywhere in the page. standard styles sheets can be used for designing a VF page. custom style sheets can be used. It has the  required attribute "value". There is no required value. Column headers  will be displayed automatically. Need to specify column headers explicitly. Q) What are the controllers used in Vf page? Ans. Standard controll...