Wednesday, September 10, 2014

39)How can we generate a pdf in visualforce page

<apex:page standardController="Account" extensions="AccountPdf"  showHeader="false"  sidebar="false" renderAs="PDF"  title="AccountReport.pdf"
         contentType="application/pdf#AccountReport.pdf" >
       
         <head>
             <title>AccountReport.pdf</title>
         </head>
         <apex:outputText value="Hello World"/>
 </apex:page>

38)How can you refresh a particular block in visualforce page ?

Using reRender attribute.

37)How much code coverage is needed for deployment?

Each trigger should have minimum of 1%. Class can have 0%. But, the total code covergae of 75%.

36)How can you call a controller method from javascript

Use action function component to call controller method from java script.

35)How can we implement pagination in Visualforce page ?

Use Standard sets controller for implementing pagination.

34)What is whoid and whatid in Salesforce ?

Whoid is the id of either contact or Lead. Whatid is the id of the related to record in activity record(standard or custom object)

33)What happens upon lead conversion ?

When lead is converted contact, account and optional opportunity is created.

32)What are the different ways of deployment in Salesforce

1) Change Sets
2 ) ANT
3) Eclipse

31)What are different portals in Salesforce.com?

Partner Portal:A partner portal allows partner users to log in to Salesforce.com through a separate website than non-partner users. Partner users can only view & edit data that has been made available to them. An organization can have multiple partner portals.
Customer Portal :Customer portal provides an online support channel for customers allowing them to resolve their inquiries without contacting a customer service representative. An organization can have multiple customer portals.

30)What is a Wrapper Class in Salesforce ?

A Wrapper class is a class whose instances are collections of other objects.

29)In How many way we can invoke the Apex class?

1) Visual force Page
2) Trigger
3) Web Services.
4) Email Services.

28)What is the difference between custom controller and extension?

Custom Controller: A custom controller is an Apex class that implements all of the logic for a page without leveraging a standard controller. Use custom controllers when you want your Visualforce page to run entirely in system mode, which does not enforce the permissions and field-level security of the current user.
Controller extension: A controller extension is an Apex class that extends the functionality of a standard or custom controller.
“Although custom controllers and controller extension classes execute in system mode and thereby ignore user permissions and field-level security, you can choose whether they respect a user’s organization-wide defaults, role hierarchy, and sharing rules by using the with sharing keywords in the class definition.”