Tuesday 10 January 2012

Making the color for each cell in a pageblocktable based on condition


Making the color for each cell in a pageblocktable based on condition


Hi,


I am trying to show you how to change the colors of cells of pageBlockTable in visualforce based on condition
and also show you how to place the string literal in the cells based condition.


Here I have created an object with the name called Employeetest__c and having three fields are 
Name(text),Status__c(checkbox),Salary__c(number).


Requirement:


When the salary>=XXX and salary<XXX then make the color for that cell under the Salary column.
Like that for different conditions we need to set different colors for each cell based on condition.


and When status checkbox is checked then then place the "Active" in the cell  under the Status column otherwise 
place the "InActive" as string literals.


controller:
=======

public class employeetestController{


    public List<Employeetest__c> lstemp=new List<Employeetest__c>();
    
    public List<Employeetest__c> getrecs(){
    
            lstemp=[select name,salary__c,status__c from Employeetest__c];
            return lstemp;
       }
    
}


page:
======

public class employeetestController{


    public List<Employeetest__c> lstemp=new List<Employeetest__c>();
    
    public List<Employeetest__c> getrecs(){
    
            lstemp=[select name,salary__c,status__c from Employeetest__c];
            return lstemp;
       }
    
}


Output:
======
VFpage with colors and string literals based oncondition


Try this all the best 

How to get the data from java app to Salesforce using webservices

How to get the data from java app to Salesforce using webservices

Integrate your Cloud Computing Apps with Salesforce.com, Java

New integration patterns have emerged to enable many applications to migrate to the cloud while leveraging existing infrastructure.
by Andrew Lawlor

Current economic conditions have created pressure to reduce the costs associated with developing and maintaining enterprise applications. As such, many organizations are turning to cloud computing technologies such as the Force.com platform from Salesforce.com, to lower costs and increase value.

If you haven't heard of it, Force.com, launched in 2007, lets you build and deliver apps in the cloud, and includes database, user interface, logic, workflow, mobile and security functionality -– all backed by a multi-tenant kernel currently powering 150K applications for more than 1.5 million users.

As more organizations begin the process of moving their critical apps to the cloud they may decide to maintain a subset of their infrastructure on-premise due to the large investments made in this infrastructure and for security reasons, whether due to institutional paranoia or legitimate regulatory requirements. New integration patterns have emerged to enable many applications to migrate to the cloud while leveraging existing infrastructure.

This article demonstrates how to build a mashup that seamlessly and securely integrates data and services sourced from on-premise infrastructure into a cloud application. By leveraging this pattern an organization can realize the manifold benefits of cloud sourcing an application whilst leveraging sensitive data and existing functionality available in on-premise infrastructure. As an illustrative example, an on-premise service built in Java and web-service enabled with Apache Axis is seamlessly invoked from within a Force.com application.

An Integration Architecture
A cloud-based application built on the Force.com platform may need to access sensitive data and invoke critical business logic available only in the company's on-premise infrastructure. Considering the traditional three-tier architecture, the entire presentation layer can reside in the cloud. The business logic layer too resides in the cloud with the exception of those critical services developed previously by the organization. Likewise, the data layer resides in the cloud and handles the bulk of the data used by the application. When sensitive data is needed the application accesses additional data services that reside on-premise utilizing integration technologies. The architecture is shown in the diagram below.



As you can see, most of the app and functionality sits on Force.com, with some data and functions residing on an intranet. The end-user accesses the Force.com application, which in turn makes secure callouts to the on-premise solution. This isn't the only way to integrate Force.com with Java, but it's illustrative of the general technique. See the Additional Integration Scenarios for other possibilities.

The Integration Mashup
To illustrate the integration capabilities of the Force.com platform, an example from the Wealth Management industry is shown. A large Wall Street bank wishes to migrate its Wealth Management CRM application to the cloud using the Force.com platform. Due to the sensitive nature of the customer's account balance information, the organization decides this information must remain under their control at all times within their self-managed on-premise infrastructure. The chosen architecture cloud-sources the bulk of the application on the Force.com platform and uses a mashup to seamlessly and securely integrate account balance information as needed from the organization's on-premise infrastructure.

The bank has an enterprise class account balance service built in Java that (in simplified form) returns the current balance given an account number. The bank's robust Service Oriented Architecture (SOA) surfaces this service so that it may be consumed from the Web using the standard SOAP protocol and securely authenticates the consumer to ensures the user has the rights to access this sensitive information. Apache Axis is used to Web Service enable this Java service. This can be done quite securely, for example by leveraging two-way SSL and restricting incoming IP ranges to those of Force.com.

The Wealth Management application displays the account balance by invoking the Account Balance Web Service in real-time with each render of the account page.
The Force.com platform uses the common Model-View-Controller (MVC) pattern to display content to the user. The View uses Visualforce markup to format the page. The Controller contains the business logic used to interact with the user. For this application, an Apex Code controller extension is used to invoke the external Web Service to retrieve the current account balance. The Model in this case is a combination of Force.com standard and custom objects (Force.com terminology for a rich database-like structure).

Java and Web Service Hosting
We're going to assume the Java web service is hosted on the intranet, on the Apache Axis web services stack. Lets look at this in a little more detail.
The Java Account Balance service, sitting on the intranet, has the following signature:

public java.lang.String getAccountBalance
(java.lang.String accountNumber)
This service returns the accountBalance for the given accountNumber, returning "Invalid Account Number" if the accountNumber is invalid. This is obviously a simplication, but illustrates the point. This service accesses an on-premise relational database to retrieve the current balance, but the details of this service aren't shown here as they are not central to this integration use-case.
In order for our cloud based Wealth Management application to consume this on-premise service it must be made available as a web service. The Apache Axis project is a very popular and mature package used to surface a Java method as a Web Service that can be invoked by any consumer with access to this on-premise server. Axis provides a Java2WSDL function that produces a standards compliant WSDL file from any given Java class file. To produce a WSDL file for our account balance service, execute the following at the command-line:

          Java2WSDL AccountService.java

Here AccountService is the name of the class that contains the getAccountBalance() method. Axis will produce a number of files that are used to Web Service enable our getAccountService method. Of most interest to our integration use case is the Web Service Description Language (WSDL) file produced called AccountService.wsdl. The WSDL file will look something like this (I've cut bits out):



    
  
    
  
  
    
  
  
    
      
      
    
  


    
      
    
  
Note that this WSDL identifies that the AccountService has one Web Service: getAccountBalance that takes an accountNumber String and returns an accountBalance String. Note also that the location of the AccountService is at an external domain: aptaria.com. This external on-premise server hosts our getBalanceService.

Now that our AccountService has been established in our on-premise infrastructure and the getAccountBalance method has been Web Service enabled (surfaced), we can now concentrate on integrating this critical functionality into our Force.com Wealth Management application.

Force.com and Web Service Invocation
In order to display to the user the current balance for an account we must configure our Wealth Management application to perform a callout to an external Web Service whenever the account page is rendered on Force.com. This section looks at how to configure Force.com to invoke external web services, and how to use the tooling to automatically generate the code to invoke the web service.

First we must enable the Force.com network security settings to allow our application to invoke outbound Web Service calls. As this is sensitive information we want to ensure that only our trusted on-premise infrastructure interfaces with our cloud based application. The Force.com platform can be configured to restrict all outbound Web Service calls to a particular IP range. This greatly reduces the risk of interfacing with a counterfeit or malicious AccountService.
Once you have identified the range of IP addresses at which the AccountService will be available, go to the Force.com Setup menu in your org (Force.com terminology for their cloud based application environment) and navigate to Administrative Setup : Security Controls : Network Access. From this page you can enter the Starting and Ending IP address of the secure AccountService.

Next we must identify the external Web Service to our application. We do this by uploading the generated WSDL into the Force.com platform. Once loaded, the external Web Service can be invoked by any Apex class (Apex is name of the Force.com platform programming language). To load the generated WSDL go to the Force.com Setup menu in your org and navigate to App Setup: Apex Classes. From this page select the Generate from WSDL button and then provide the location of the WSDL file generated above, and then press the Parse WSDL button.
Once the WSDL file has been loaded you will notice a new Apex class appears in the Org: AccountService. The generated class will look something like this:
//Generated by wsdl2apex

public class AccountService{
  public class getAccountBalance_element {
   /* snip */
  }
  public class getAccountBalanceResponse_element {
   /* snip */
  }    
  public class AccountServicePort {
      public String endpoint_x = 'https://aptaria.com:9081/AccountService/services/AccountServicePort';
        public String getAccountBalance(String accountNumber) {
         /* snip */
        }
  }
}
This class was completely auto generated by the Force.com platform when our AccountService WSDL was loaded. Notice that the endpoint_x variable identifies the URL address of our AccountService. The beauty of WSDL2Apex is that we don't need to concern ourselves with the details of this code. The platform handles the dirty work of invoking our getAccountBalance Web Service for us. All we need to do is call the public method getAccountBalance and pass in an accountNumber String.

The Force.com Application User Interface

Now that our AccountService is available and the platform is aware of how to invoke it as a Web Service we can update our Force.com Financial Account screen to invoke the service with each render of the page. This section looks at how to use the markup language to display the data.



To do this we use the Force.com platform's Visualforce markup language. Visualforce uses HTML-like tags (actually, more similar to Java Server Faces) to produce different visual constructs. In our case we need to display the return value from our getAccountBalance service in such a way that the user is unaware that the balance is being provided from an external web service.
The following is the Visualforce used on our Financial Account page to show the Account Balance:

    
        
            
                
            
            
                
{!AccountBalance}
The Visualforce tags define a two column table for the label 'Account Balance' and the variable {!AccountBalance}. Visualforce automatically calls the get method defined in current controller: getAccountBalance. This method invokes the external web service and returns the AccountBalance value for display to the user in real-time. This is the secret sauce of the mashup. While standard controllers pull data directly from Force.com standard and custom objects, we need an account balance that isn't available in the cloud. Instead we integrate with an on-premise Web Service to provide the needed sensitive information. For this we need to utilize an Apex controller extension. The Force.com Application Controller Layer The user interface layer has a nice separation of "View" from "Control". This section looks at how to flesh out the controller layer to invoke our web service so that the appropriate data can be displayed. Notice that the includes the extensions property. This property identifies a controller (the C an MVC) extension called AccountServiceController. This is where we extend the behavior of the standard Visualforce controller for the Financial_Account__c object by adding the capability to retrieve an account balance through integration with an external web service. The following is a complete listing of the Apex class: global class AccountServiceController { Financial_Account__c account; String balance =''; // controller public AccountServiceController(ApexPages.StandardController stdController) { this.account = (Financial_Account__c)stdController.getRecord(); } //get and set accountbalance public String getAccountBalance() { String accountNumber = [Select Account_Number__c from Financial_Account__c where Id=:account.Id].Name; //Invoke service balance = showBalance(accountNumber); return balance; } public void setAccountBalance(String balance) { this.balance = balance; } //Invoke the web service callout static String showBalance(String accountNumber) { String accountBalance = ''; //call Authentication Call out String isValid = AuthenticationCallout(); System.debug('Auth Result '+ isValid); if(isValid == 'true'){ AccountService.AccountServicePort stub = new AccountService.AccountServicePort(); stub.setApexTest(testFlag); accountBalance = stub.getAccountBalance(accountNumber); } return accountBalance; } //Authentication callout (cheap - use two-way SSL for real) public static string AuthenticationCallout (){ HttpRequest req = new HttpRequest(); req.setEndpoint('https://aptaria.com:9081/HttpAuthentication/Authenticate'); req.setMethod('POST'); req.setBody('username=admin&password=admin123'); Http http = new Http(); String result = ''; // Make a real callout since we are not running a test HttpResponse res = http.send(req); System.debug('Authenticateresult'+res.getHeader('authValid')); result = res.getHeader('authValid'); return result; } } Visualforce automatically call the getAccountBalance method when it attempts to perform variable substitution for the {!AccountBalance} element. This method identifies the AccountNumber from page context using SOQL and calls the showBalance method. The showBalance method first authenticates to the external web service using simple authentication. In a real implementation, you'll want to use a stronger form of integration -- something like two-way SSL for example. Once authenticated, the method then invokes the AccountService methods auto generated when we imported the WSDL file to invoke the external web service and retrieve the given account's balance. Visualforce then displays the returned account balance to the user transparently, as if the data resided in the cloud. Pulling It All Together Our on-premise account balance service is available and Web Service enabled with Apache Axis. Force.com platform network security settings have been configured to allow outbound Web Service callouts to this critical service. The WSDL has been loaded into our application enabling our app to easily invoke our external web service. The Visualforce on our Account page has been modified to pull the account balance using a controller extension. This controller extension has been coded to invoke the code auto generated from our WSDL to call our external AccountBalance Web Service. When the user logs into our Wealth Management App and navigates to the Financial Account page for a given account number (10001002, for example), the following screen appears: The key point here is that the account balance for account 10001002 ($12,345.68) appears no differently from the other data about this account page (although there is a slight delay before this field appears because of network latency). The user is unaware that this data is being served from an outside resource. The integration pattern mashup provides seamless and transparent access to this sensitive data. Additional Integration Scenarios The demo above focuses on the outbound Web Service invocation use-case, but other scenarios are equally critical to a successful cloud-source strategy. This application can be used to execute an account transfer use-case by invoking a service that updates data in an on-premise application. You can use the built-in Force.com trigger and workflow functionality to perform this whenever data changes, or use the code scheduler to time such transfers at particular periods of the day or week etc. Conversely, an on-premise application can access business logic and data in an application built on the Force.com platform through inbound integration. To enable this capability one simply adds the webservice keyword to any Apex method - the Force.com stack handles the rest of what it takes to get the web service up. For example, on-premise infrastructure may invoke a Force.com web service to return the total number of accounts available in a Force.com org. Once this Apex method has been web service enabled, one can use the Force.com platform to easily generate its corresponding WSDL file, which can be loaded into external infrastructure for easy integration with your cloud app. A common use for integration with Force.com is to synchronize data between two complimentary enterprise systems. Many organizations use Salesforce.com for CRM and another application such as SAP or Oracle Applications for ERP. It is critical that these two enterprise systems properly synchronize their Account data. Integration is commonly used for this purpose. As new customers are closed through the Salesforce.com CRM system a web service callout can be used to notify downstream ERP systems for fulfillment and support. Conversely, customers are frequently added directly into ERP systems. In this case the ERP system can notify your app on Force.com of the new Accounts via inbound web service calls. Other integration scenarios include using email services (sending or consuming emails from trusted sources), and of course invoking HTTP-based service instead of the SOAP ones used in this article. Summary This article explores how to integrate the Force.com platform with on-premise Java infrastructure. We have shown how a mashup can be used to seamlessly and securely leverage data and logic from on-premise Java services by integrating them directly into a Force.com application, and sketched other integration techniques. The Force.com platform offers tremendous capabilities to seamlessly integrate your cloud sourced applications into your enterprise. Applications built on the Force.com platform can easily produce or consume data and services for your existing applications. More developer resources can be found on Developer Force athttp://developer.force.com. Andrew is a respected thought leader in the Cloud Computing space generally and Force.com development specifically. He is a published author and respected authority on the proper application of cutting-edge information technologies to advance business goals. Andrew founded Aptaria, a registered Salesforce.com consulting partner that helps organizations of all sizes build mission critical business applications on the Force.com cloud platform. Andrew holds a Force.com Developer certification.

Salesforce Tutorial for certification(Developer 401)


Salesforce Tutorial for certification(Developer 401)


Salesforce Applications

  1. To access Force.com platform visit the URL https://login.salesforce.com and click on the Setup link in the top nav bar.
  2. To access apps, select Create|Apps menu in the left navbar.
  3. To create a new Application, a developer needs to specify App Label, App name, description, custom app logo and a list of tabs. App Label is displayed to users, and App name is the internal name referred in code.
  4. An application is a set of tabs.
  5. Tabs are of three types
    1. Custom object Tab
    2. Web Tab
    3. Visual force Tab
  6. Tabs are used to organize objects and records. Each tab is associated with a unique object. A tab also lets you specify a color and an image.
  7. One of the tabs in the application is a default landing page.
  8. Saved applications appear in the Apps menu on the top left navbar
  9. Salesforce provides a Force.com IDE. This is an eclipse plugin application that provides a development environment for VisualForce and Apex.
  10. In Salesforce code without desired test coverage cannot be deployed. A minimum of 75% test coverage must be achieved before deployment.
  11. Native User Interface refers to the default user interface that Salesforce provides

Force.com's objects, fields and relationships

  1. Objects logically correspond to database tables in a relational database. Fields of an object is similar in concept to column in relational database.
  2. Objects can be standard or custom. Standard are objects are predefined by Salesforce like Accounts, Case, Contact etc. Custom objects are created by developers based upon application requirements.
  3. Custom objects have the following characteristics
    1. Custom objects store information that is unique and important to your organization.
    2. Custom objects are reportable and search-able.
    3. Custom objects have configurable access control features.
  4. Force.com provides undelete functionality on objects. Deleted objects go to a recycle bin with an expiry date of 45 days. An administrator may delete objects from recycle bin.
  5. Fields of type Picklist cannot be made required.
  6. There are three type of page layouts:
    1. Detail
    2. Mini
    3. Console
  7. Objects have following fields that need to be entered by developers -
    • Label
    • Plural Label
    • Object Name
    • Description
    • Record Name
    • Record Type
  8. The field for record name is displayed by default when the object has to be displayed (for example in search results). The record type can be text or auto-number. Auto-number can take values like A-{0001}, A-{0002} etc.
  9. The Object name is used to access the object programmatically. __c is added as a suffix to the custom object names. The label name is used for display of the object.
  10. The standard fields are added automatically. Examples of standard fields are Created By, Owner etc.
  11. Custom Fields are added to an object by developers. In the custom object definition detail screen there is a section of custom fields. Click New to create new custom fields in this area.
  12. Custom Fields have properties like:
    • Data Type
    • Field Label
    • Field Name
    • Required checkbox
    • Description
    • Default Value
  13. Examples of valid field types are
    Field TypeComments
    TextText can be upto 255 characters
    Text AreaText Area can be either 255 characters or 32K characters
    URL
    PicklistCan be single select or mult-select. The developer needs to provide valid values
    Currency
    Checkbox
    Percent
    Number
    The field types are aligned to user interface elements like picklist and checkbox.
  14. Changing the data type of existing custom fields is possible, but doing so may cause data loss.
  15. Fields can be set as unique, required or as external id. A required field is always displayed in the edit page. A field of type external id is a record id from another system. The performance of reports and SOQL is better for fields defined as external ids. Fields of type number, text and email can be set as external id. Each object can have up to three external ids.
  16. A field defined as encrypted is not visible to users. Typical usage of encrypted field is for password. Only users with "View Encrypted Data" can view the encrypted fields. Encrypted fields are editable.
    1. This is a provisioned feature, so you must contact Salesforce to enable it.
    2. Encrypted custom field cannot be unique, an external ID, or have default values.
  17. Objects can have upto 500 custom fields.
  18. When an object is created, a user interface is created automatically for Create, Update, Read and Delete operations.
  19. Fields of two Picklists can be made dependent on each other. As an example consider an application with customers in US and Canada. If there are two picklists - one for country and the other for state. Based upon user's selections of country, the state settings need to get updated. This is implemented by defining controlling and dependent picklists. In the above scenario, country becomes the controlling picklist and state becomes dependent picklist. The controlling and dependent picklists are defined using "Field Dependency" button in "Custom Field and Relationship" section.
  20. Standard picklist can be controlling picklist but not dependent picklist. Maximum number of values allowed in controlling field is 300. A custom multi-select picklist cannot be controlling field in a picklist.
  21. Merge fields are fields that display values based upon formula calculations.
  22. Salesforce supports history tracking on change in values of fields. This can be enabled for up to 20 fields in an object.
  23. Custom objects can be represented using a Metadata XML.
  24. Deleted data and metadata is stored in recycle bin.
  25. Database tuning is managed by Salesforce. How Objects and fields are stored in the database is internal to Salesforce.
  26. Object Relationships

  27. Force.com allows you to create relationship between objects. The "Custom Fields & Relationship" section of objects is used to define relationship between objects.
  28. There are a two types of object relationships that Salesforce supports -
    1. Lookup relationship
    2. Master-detail relationship
    These relationships are used to implement one-to-many relationship. They are created as fields in the child record. As an example in a recruitment application if one applicant can have many interviewFeedbacks, we could create a lookup (or master detail) relationship in the interviewFeedback object pointing to the applicant object.
  29. In Master Detail relationship, if the parent record is deleted, then all its children records are deleted.
  30. Child records in master-detail relationship do not have owners. They inherit ownership from the parent record.
  31. In Master detail relationship, the parent field is required. Also the parent field once specified cannot be changed.
  32. Standard Object cannot be on detail side of Master-Detail relationship.
  33. In the related list section of parent objects, only one field of the child object is displayed by default. This is the field specified as Record Name in the child object. To add more fields, search lookup layout needs to be updated.
  34. Rollup-summary fields are supported in master detail relationship. The parent object can use roll-up summary field type to perform operations of sum, maximum, minimum, count among its children records. These fields are read only fields and are used to calculate values from a set of records.
  35. Many-to-Many relationships are implemented using two master-detail objects. One Junction object is used as the child of the objects between which many-to-many relationship needs to be established.
  36. The table below compares Master Detail and Lookup relationship
    Lookup relationshipMaster Detail relationship
    Is Parent a required fieldNoYes
    Maximum number of relationship in an object252
    Security of parent determines child record's accessNoYes
    Deleting parent record deletes childrenNoYes
    Parent can be a child in another relationshipYesNo
    Roll-up summary in parent supportedNoYes
  37. Self relationship is a lookup relationship to itself. An example usage could be organization chart where an employee's manager is also an employee.
  38. Hierarchy Relationship exists only for User object. In this, developers create a manager field in User object to relate to another object.

Approvals and Workflow in Salesforce

Salesforce provides extensive support for implementation of workflow and approvals.
  1. A queue can hold a predefined set of objects and consists of a set of users. Any of the queue members can pick up tasks assigned to the queue. Users or Queues can be owners of records.
  2. Approval processes

    Salesforce supports wizard based easy to configure approval process. After an object is selected, the wizard guides the user through a step-by-step setup. Approval process is triggered when a user clicks on the "Submit for approval" button.
  3. The approval process consists of the following steps -
    1. Process definition
    2. Initial submission actions
    3. Step definitions
    4. Final Rejection actions
    5. Final Approval actions
    6. Final Recall actions
  4. The Process Definition step consists of the following sub-steps:
    1. Provide the name of process
    2. Specify entry criteria for records
    3. Specify who is going to approve
    4. Specify email template
    5. Fields to be displayed in the approver page
    6. Specify who is going to send approval mail
  5. Workflow rules are like triggers. Action is triggered when a record meets an evaluation criteria. Workflow rules definition does not impact existing records. Workflow rule gets applied to new record creation or edits.
  6. Workflow rule consists of three steps
    1. Select the object
    2. Specify evaluation criteria (when should the workflow rule be executed, example for new records are created)
    3. Define rule criteria (example when status of job applicant is approved)
  7. Workflow actions can include sending an email, setting values to fields, sending an external message or creating a task.
  8. There are two differences between Workflows and Approval process
    WorkflowApproval process
    They are activated when a record is saved.approval process are triggered by explicitly clicking the "Submit for Approval" button.
    Workflow consists of single step and single actionApproval process consists of multiple steps. Also different action is taken based upon whether the record is approved or rejected.
    Workflows can be modified or deleted.In approvals some attributes cannot be modified. Processes must be deactivated before approvals can be deleted.
  9. Time-based workflow allows action to be triggered after a delay. As an example we could implement following business logic using time-based workflow: In a recruitment application if for no high priority position no candidates are assigned in a week, then send a mail to Recruitment Manager.
  10. Time-based workflow cannot be executed when evaluation is set to "Every time a record is created or updated".
  11. Approval processes can be single or multiselect process. Multi-select processes require end user authorization for record promotion.
  12. Approval process is unique for object type.
  13. Parallel approval process allows specifying (upto 25) multiple approvers simultaneously. The approver setting could be set to unanimous or first action. In unanimous parallel approval process, all approvers must approve a request, before it is considered as approved.
  14. Possible actions of workflow and approval process are -
    1. Creating a task
    2. Sending a message to external system (outbound message)
    3. Updating a field value
    4. Sending an email
    5. Locking a record
  15. Outbound message helps keeping salesforce coordinated with other applications.
  16. Dynamic approval process is used to route approval requests to users listed in lookup fields on the record requiring approval. In this, approver names are defined dynamically from an object.
  17. Process Visualizer provides Read only visual of an Approval process. It can be accessed by clicking on “View Diagram” button.

    Salesforce Business Logic

      Business logic is a set of rules and calculations that handle information exchange between User Interface and Database. Declarative Business Logic includes: Queues, Workflows, Validation and Assignment Rules, Rollup summary fields, Cross Object fields.Programmatic Business Logic includes Apex, Visualforce Controllers, Web Services API. Automated processes are:
      • Validation Rules
      • Assignment Rules
      • Auto Response Rules
      • Workflow Rules
      • Escalation Rules
      Queues are used to manage a shared workload more effectively.
    1. Validation rules can be attached to fields. They are executed when a record is created or updated.
    2. When defining a validation rule, an error condition and error message are defined. If evaluation of error condition results in true value, record is not saved, and the error message is generated.
    3. Some fields are of type Formula. They are derived from other fields. Validation rules and formula follow the same expression language.
    4. A set of functions used in Formulae are included below.
      FormulaeDescription
      TODAY()Returns todays date
      IF(expr,x,y)if expr is evaluated to true, x is returned, else y is returned
      TEXT(field)Returns the text value of a picklist
      ISPICKVAL(field,value)Checks whether value of field matches the input parameter. Returns true if there is a match
      ISBLANK(field)Returns true if field is blank
      AND(expr1,expr2)Performs a logical AND
      OR(expr1,expr2)Performs a logical OR
      HYPERLINK(url,text)Creates a link to the specified url
      ISCHANGED(field)Checks id the field's value has changed
      PRIORVALUE(field)Returns the previous value of field
      ISNEW()Returns true if a new record is being created.
      INUMBER()Returns true if the field is a number
      IMAGE()Used to display an image
      REGEX()Compares a text field to a regular expression and returns true if there is a match
      VLOOKUP()In an object consisting of key value pair, VLOOKUP returns value for a key
      A few things on these functions:
      • Case(), If() and IsNumber() are available for all features like approval, workflow, validation and formula.
      • Image() is only for Formula fields.
      • Vlookup() is for Validation rules.
      • IsChanged() and PriorValue() are for workflow, only when “everytime a record is created or updated”.
    5. Methods are used in Formulae fields, Validation rules, Workflow rules, Field updates, Default values and Approval process. Some of these methods are only available in certain areas. CASE, IF, ISNUMBER are available in all places. IMAGE is available only in formulae fields. VLOOKUP is available only in validation rules.
    6. Cross-object formula span two or more objects by referencing merge fields.
    7. Difference between Roll Up and Cross Object Fields:
      1. In cross object formulas, we navigate from child object to parent or grand parent object(up to 5 levels). Field is displayed on child object. While in Roll Up Summary Fields, we navigate from Parent to Child object.
      2. Formula fields do not store the value on the record but Roll Up Summary fields stores the value and changes can be seen on parent.
    8. Limitations of Cross Object Fields:-
      1. You can’t reference cross obect formula in roll up summary field.
      2. You cannot reference merge field for objects related to activities.
      3. You cannot reference record owner merge field for any object.
    9. Debugging Tools

    10. View Setup Audit Trail is used to view list of configuration changes. It is available in Security Controls menu in the Setup area. Examples of audit trail are creation of object, adding a new field, changing field type or setting up a new approval process. By default 20 last configuration changes are displayed. Changes made in last 180 days can be exported into a csv file. It can be configured by admin or developer.
    11. Field history tracking can be enabled at object level at the time of creation of objects. Up to 20 fields can be tracked for one object. As an example, any changes in field values are stored as part of Field history tracking. During Field history tracking, Time of change, user who made the change, prior value and new values are stored. For data types Multiselect Picklist and text area (long), previous and new values are not saved.In the Custom Fields and Relationship area of Object configuration, "Set History Tracking", is used to enable field level tracking. Review History related list can then be added to page layout to view changes to fields.
    12. Force.com platform provides three main mechanisms for debugging errors. These are also known as Auditing tools:-
      1. Field history allows developers to track changes to field values of up to 20 fields for any object.
      2. Debug Logs is a persistent store in which logs are stored for transactions performed by up to 20 users.
      3. System Logs allows developers to run apex commands and view the logs
      4. Setup Audit trail allows developers to view all configuration changes (example creation of object, changing field type, creating a workflow etc.) made in last 180 days.
    13. Setup Audit Trail of Salesforce is used to track configuration changes made. Example of configuration changes are date of change, description of the change, user who made the change. Twenty most recent changes are displayed in the audit trail. Last 180 days changes can be exported into a csv file. View Setup Audit Trail feature is available via the Security Control menu.
    14. There is a link to System Log at the upper right corner of the page. System Log allows developers to enter Apex code and see the results of running this code. System Log display information about workflow rules, validation rules, debugging information and resource utilization.
    15. To control quantum of logging, system log takes two parameters Log category and Log level. Log categories can take the following values -
      • None
      • Database
      • Workflow
      • Validation
      • Callout
      • Apex code
      • Apex profiling
      Log level indicates level of detail in the message. It takes the following values
      • None
      • Error
      • Warn
      • Info
      • Debug
      • Fine
      • Finer
      • Finest
    16. Debug log is an organization-wide persistent log. It can store debug log for transactions performed by specific users. Logs for up to 20 users can be persisted. Debug Log is available via the Monitoring menu.
    17. Salesforce supports history tracking on change in values of fields. This can be enabled for up to 20 fields in an object. In Custom Fields and Relationship, set history tracking is enabled for a set of fields. Review history can be added to page layout. Information stored includes - changes to field values, time of change, user who changed the field. Old and new values of fields are not stored for multi-select picklist and long text area.

Salesforce DataLoader

  1. Every object has a standard field called id. There is no need to define an explicit primary key in custom objects. The standard id field can be used as primary key.
  2. The id is alphanumeric. id can be either 18 digit case-insensitive or 15 digit case-sensitive.
  3. The first three characters of the id identify the object. Ids can be identified in three ways -
    • From the URL when a record is displayed in Salesforce
    • From reports
    • Through the web services api. Data Loader uses web services api to display the ids.
  4. The id displayed by a report is the 15-digit case-sensitive id. The ids returned by web services api are 18-digit id. For updates web service accept both the 15-digit and 18-digit ids.
  5. 15-digit id can be converted to 18-digit id and vice-versa.
  6. There are two types of Data Loader logs:
    • sd1.log
    • sd1_out.log
  7. When loading data into a salesforce application dependencies between objects determine the order in which objects are loaded. If there is a one-to-many relationship between A and B, the data for A should be loaded before the data for B.
  8. Data Management is an ongoing process to keep data in your application up-to-date, accurate and clean whereas Data Migration is one time task.
  9. External ids option can be specified on custom fields for fields of type text, number or email. This creates custom index in database. A maximum of three fields can be set as external ids. Specifying a field as external ids, leads to improved reporting and SOQL performance. External ids prevent duplicate entries when exporting data. Both upsert and external ids are used for migration and integration of data.
  10. If "Modifiable System Field" configuration is enabled, then system fields (like creation date) can be set to any value during initial data load. These values can however not be updated after the initial upload. These fields are accessible through the API. These are backward compatible with all SOAP based APIs available for all custom objects. These are Read only fields.
  11. Salesforce determines an operation Upsert. Upsert stands for update + insert. When an upsert is performed, if a record exists it gets updated. If the record does not exist, it gets inserted. This is useful in large data uploads, and if the connectivity is not stable. Matching of record can be performed on the basis of Salesforce id or External id. When performing an upsert, only single external id field is used.
  12. Import wizard are available via the standard Salesforce application using easy to use interface and do not require programming. Import wizard can be used to load up to 50,000 records. Import wizard can be used for de-duplication of data. Import wizard can be used to import accounts, contacts, leads, solutions and custom objects.
  13. Web Services API based tools can load more than 50,000 records and can support all object types. It also allows developers to schedule regular data loads. These support nightly feeds. APIs can delete multiple objects at the same time.
  14. Data Loader is an API based product by Salesforce. It can be run from command-line. It can generate and import from csv (Comma Separated values) files. It supports custom relations imports using upserts. It also support loading from JDBC.
  15. Data Loader can be installed on a desktop from the Salesforce Data Management menu. Operations supported by data loader are -
    • Extract
    • Upsert
    • Insert
    • Delete
    • Update
  16. Command-line version of data-loader supports regular scheduling of loads.
  17. Mass Transfer Tool is used to transfer multiple objects data from one user to another. User should have the following permissions:
    • Transfer record permission
    • Edit permissions
    The tool can be used to change the ownership of the record.

Force.com development platform

  1. Salesforce provides two type of licenses
    1. Salesforce: full access to CRM standards, Force.com custom and application exchange apps
    2. Salesforce platform:. Salesforce platform license allows access to custom apps, it does not allow access to online CRM product.
    Feature licenses can be purchased for additional features such as Marketing User, offline user, Apex mobile user etc. CRM access means access to Standard objects like Cases, Campaigns, Opportunities etc. Platform access means access to Custom and Standard objects.
  2. Force.com platform uses the standard Model View Controller design pattern. The MVC pattern is implemented as below in Force.com platform.
    PatternForce.com implementation
    ModelObject (custom or standard)
    ViewVisualForce pages
    ControllerLogic written in Apex that controls navigation
  3. The Create menu is used to provide the declarative framework of Force.com platform. The Develop menu is used to provide the programmable framework.
  4. Page Builder is used to generate user interface for CRUD (Create, Read, Update, Delete) operations of objects. This user interface is created automatically by Salesforce and can be used to create reasonably complex applications withot writing VisualForce or Apex code.
  5. Salesforce allows data types of existing fields to be changed, however this may lead to loss of data.
  6. When you add a custom object tab, all the following will be accessible with the object:
    • Recent items
    • Sidebar search
    • Added to new link/ Create new object drop down
  7. To make a field required, there are a few different ways.
    • Check the box for required on Object Definition
    • Create a Validation Rule
    • Specify that the field is required in the Page layout
  8. Page Layout supports a drag-and-drop interface to develop screens. It allows addition of space and sections, and moving of fields across the screen. It supports making a field read-only or required.
  9. There are two type of activities:
    • Task: It is related to a record , assigning a task
    • Events: Any calendaring event, meeting etc
  10. A deleted record is stored in recycle bin with an expiry date. Deleted records can be recovered for upto 45 days.
  11. SOQL stands for Salesforce Object Query Language. SOQL is used for performing queryies on objects.
  12. SOSL stands for Salesforce Object Search Language. SOSL is used for performing full text search.
  13. S-controls were used to upload contents such as java applets or active X controls for use in dynamic custom links or web tabs. These have been superseded by visualforce pages. S-controls provide client side programming.
  14. Salesforce provides sandboxes that may be used for development and testing. Full Copy Sandbox allows copies of metadata/configuration along with all the application data to be copied from production to a sandbox environment. The sandbox can then be used for testing and simulating reported problems. Record ids in production and full copy sandbox are also same.Configuration only sandbox copies all your production organisation’s reports, dashboards but exclude all your organisation’s standard and custom object records, documents and attachments. There is a size limit of 500MB(250,000 records)
    Developer sandbox is a special configuration sandbox only for single developer. It also allows copying of metadata and configuration, but not copying of application data. Changes from the active development can be isolated until they are ready to be shared. Size limit is 10MB(5000 records)
    Developer edition license does not allow copying of configuration from production developer environment.
  15. Territory Management: It is used to define more than 1 role hierarchy.

Reports and Dashboards in Salesforce

Salesforce provides powerful reporting and generation tools on the data stored in the objects.
  1. In reports data displayed is as per running user's security access. Reports can be run on both standard and custom objects. Reports are stored in folders. Users with access to these folders can run the reports.
  2. Reports data is always generated in real time. When a report is saved, reports configuration parameters are stored - but the generated data is not stored.
  3. There are three type of reports
    1. Tabular report. This is the most basic report. It displays just the row of records in a table like format with grand total. Tabular reports cannot be used for generating dashboards.
    2. Summary report. This is the most commonly type of report. It allows grouping of rows of data. It supports sorting and displaying subtotals. For example in a recruiting app, a summary report could be used to display open positions classified by department name.
    3. Matrix report. This is the most complex report format. Matrix report summarize information in a grid format. Matrix reports allows records to be grouped by both columns and rows.
    Summary and Matrix reports can be used to generate dashboards.
  4. Reports provide two options of exporting data into Excel.
    1. Printable View - Export report with formatting into Excel
    2. Export Details - Export raw data
  5. Reports present in public folders can be emailed to SalesForce users.
  6. Report display upto 2000 rows of data. Larger reports can be emailed to Excel.
  7. Generation of reports requires following steps.
    1. Selection of object
    2. Selection of report type
    3. Select type of information to be displayed (example count, average)
    4. For summary and matrix reports, specify how fields should be grouped
    5. Select columns on the report
    6. Select column order on the report
    7. Specify filtering criteria which should be used to select records
  8. Custom reports let the developers define which all fields should be available in a report. Custom report allows user to change field names. Custom reports allow developers to select related fields (upto four levels). The custom reports also allow developers to add sections to group fields. Once a custom report is created it is available in reports tab and user may create reports from it.
  9. Object relationships that are supported by Custom Report Types are -
    1. Include all records that have children
    2. Include all records that may or may not have children
    As an example consider a recruiting application with two custom objects Position and InterviewFeedback. Also assume that InterviewFeedback is the child of Position object. The first option above will display only those Position objects that have at least one InterviewFeedback as their child. The second option will display all Positions. It is not possible to display Positions that do not have any InterviewFeedback using Salesforce's reporting mechanism.
  10. There are three steps in creating custom reports -
    1. Select an object, folder and report label.
    2. Select related objects that need to be included.
    3. Select fields available for report using a drag-and-drop layout editor.
  11. Custom report types are available via the menu option Create-->Report Types
  12. Analytical snapshot allows reports run at scheduled time to be stored as objects. Analytical snapshots are used to perform trend analysis. As an example if we want to view how monthly sales are growing, fields in a report with sales figure can be stored in a custom object every month using Analytical snapshot. Data in this custom object can then be used to perform trend analysis.
  13. Analytical snapshot are available from the Data Management menu option. Source report in Analytical snapshot can be of the type Tabular or Summary.
  14. Setup Analytical reports require a four step process
    1. Select source report
    2. Select custom object
    3. Map source report fields to custom object fields
    4. Schedule the frequency for taking the snapshots
  15. There are two type of Reports
    1. Standard Report type
      • Created when a object is created
      • created when relationships between objects are created
      • Always inner joins
      • Cannot be modified.
    2. Custom Report type
      • Created by Admin or users with “Manager Custom Report types”.
      • Used to streamline the reporting process.
  16. Key concepts on Custom Report Type
    1. Saving a custom report only saves the parameters of the report. The data is always real time.
    2. CRTs are reporting templates that admin or users create to streamline the reporting process.
  17. Dashboard

  18. Dashboards are graphical representation of reports. Dashboards can be generated for summary or matrix reports (and not for tabular reports). Dashboards display data as per last time report was run.
  19. A dashboard can have upto 20 components
  20. There are five type of dashboards
    ChartUsed for comparisons
    TableGood for showing top five, bottom five lists.
    GaugeUsed to show progress towards a goal
    MetricShows a single number
    VisualForce pageused to pull data from other sources
  21. Further there are six type of charts
    1. Vertical column
    2. Horizontal bar
    3. Line
    4. Donut
    5. Funnel
    6. Pie
    Funnel is used to show proportion of values against each other. Pie is used to demonstrate proportion of single value against total. Donut is used to demonstrate proportion of single value against total and also show the total value.
  22. The folder in which dashboards are stored determines which user has access to running the dashboard. The dashboard data is based upon the reports data. When a user views the drill-down report for a dashboard component. running user's access permissions determine what data is displayed on the drilldown report. Hence it is possible that the data in the drill down report does not match the cumulative dashboard data.
  23. Dashboard also support automatic refresh and email. The refresh and email can also be scheduled at intervals - daily, weekly, monthly.
  24. Two things that determine access to dashboards:
    • Dashboard Folder
    • Running User
  25. Limitations of Salesforce reports

  26. Although fairly powerful, Salesforce reports have certain limitations. These are explained below.
    1. Support for trend analysis in Salesforce is fairly limited.
    2. User Interface of Salesforce reports and dashboards is fixed. Salesforce does not support pixel perfect report.
    3. Salesforce reports do not support importing data from other sources
    4. When displaying objects and their children, Salesforce does not support reporting on objects that do not have any children.
    5. If an object has two different related lists, then Salesforce reporting does not support displaying both these related lists together.
  27. To work-around these limitations, Salesforce customers have the following three options.
    1. Reporting as a service: Data resides on Salesforce. New Reports get generated from same data source
    2. BI as a service: Data is moved to a different destination on cloud. Reporting is performed on this new data server.
    3. Datawarehousing as a service: Data is exported to the customers server and reports are generated from the server located at customers location.

Overview of Security in Force.com development platform

  1. Every user in Salesforce has a profile. Profiles are of two types.
    1. Standard profile
    2. Custom profile
    A user's profiles determines access to objects, and fields in objects.
  2. There are six type of standard profiles -
    1. Standard user
    2. System Administrator
    3. Contract Manager
    4. Marketing User
    5. Read Only
    6. Solution Manager
  3. Profiles control-
    1. The objects the user can access
    2. The fields of the object the user can access
    3. The tabs the user can access
    4. The apps the user can access
    5. The page layout that is assigned to the user
    6. The record types available to the user
  4. Standard profiles cannot be deleted. Access permissions to objects (and their fields) of standard profiles cannot be edited. Standard profiles have access to all standard objects. Read-only profile have read-only access to objects. However access to tabs and applications can be configured for standard profiles.
  5. Access permissions of Custom profiles can be edited. Custom Profiles are created by developers by cloning from a standard profile.
  6. For each profile one application has default status.
  7. Record Types are associated with profiles. Record type play two important roles in Salesforce -
    1. They help define values to be shown in picklist for different profiles.
    2. They are used to define a mapping between page layout and profiles. This ensures that different users are displayed different views of the same page, depending upon the layout template selected.
  8. A record is an instance of an object.
  9. Removing a field from page layout does not ensure that security of that field. The field may still be accessible using the API.
  10. Security in Salesforce is defined at multiple levels. These levels are -
    1. Security at object level
    2. Security at field level
    3. Security at record level
      1. Organization-wide defaults
      2. Role-hierarchy
      3. Sharing rules
      4. Manual Sharing
  11. Object level security is given to profile level. Object level security is set up via Manage Users-->Profile section. Access for Read, Create, Edit & Delete can be set at standard and custom objects.
  12. Field-level security is also applied at profile level. The field-level security is available via the "Set Field-level security" button in the field definition page. At field level, for each profile valid settings are Visible and Read-only.When a user logs in the list of objects that are displayed to her is determined by object level security, and list of fields that are displayed to the user is determined by field level security settings of that profile.
  13. The next set of security concepts work at record level. These constraints determine which records should be displayed to the users. The four constraints that determine record level access are - organization-wide defaults, role-hierarchy, sharing rules and manual sharing.
  14. OWD stands for Organization wide defaults. This setting is defined at object level. OWD defined the default record level sharing for objects. All profiles get at least the privileges defined in OWD. OWD takes three different values -
    1. Private (Cant view and edit)
    2. Public Read only (Can view)
    3. Public Read-Write (Can view and edit)
  15. Key concepts about Organization wide default -
    1. To find out what should be set as OWD for an object, first find out which user requires least access to an object. OWD is set based upon this users access requirement.
    2. Most restrictive record access is defined using OWD. Access to additional records is made available through Role hierarchy, Sharing rules, Manual sharing.
    3. We can set OWD settings for both Standard and Custom Objects.
    4. Changing OWD settings can delete Manual Sharing if that sharing is no longer needed.
    5. Public Read/Write is default OWD settings.
  16. Role Hierarchy allows additional users access to records. A hierarchy of roles is defined based upon access requirements at record level. Each user belongs to a unique role. If a role has access to some record, than its parent and ancestors will also have access to this record. Roles can be created using the Manager Users menu. Roles are used to control record access, where as profiles are used to specify access at object and field level.
  17. Public group used in a sharing rule. It is used to give access to folders. It consists of users, roles or "roles and subordinates". The default Public Group is “Entire Organization”. We cannot assign Public Groups to profiles.
  18. Another related concept that Salesforce defines is Public group. Public group consists of users, roles or "roles and subordinates".
  19. Sharing rule is defined using public groups. Record that match certain condition can be assigned to users in public groups using Sharing Rules. Sharing rules functionality is available via the menu Sharing Settings.
  20. Manual Sharing is used to grant one-off access. Manual sharing can be granted by record owner, any one above the owner in role hierarchy and System Administrator. Manual sharing is used to handle exception cases where access to a particular record needs to be given to a specific user. There is a Sharing button on the records page. This is used to provide manual sharing. The Ownership of the record can be transferred to any user who has at least Read permission on the record.
  21. If the Read permission for the object is revoked from the users profile, the user will not be able to see their own record.
  22. Full access to the records means user can View, Edit, Transfer Ownership, Delete and Share the record. Full access is granted to:
    • Record Owner
    • Users above record owner in role hierarchy.
    • Users with “Modify All Data “ permission i.e. Admin
  23. Apex Sharing Reasons can have upto 10 Apex Sharing Reasons. It can only be given for Custom Objects.

Salesforce Sites

  1. User Interface can be private (internal Salesforce users) or public. Public interfaces are provided to anonymous users using Sites - anyone could access a website built on Sites without having a Salesforce login.
  2. If Sites is licensed, the functionality of Sites is available at Develop-->Sites.
  3. A sites user has a unique domain name. One domain name can be used to support multiple websites. Example domain name could be - http://ap1.mydomain.salesforce.com/siteName . The domain name must be unique among all site users and can represent the organization's name.
  4. Creation of sites requires specifying fields like Site label, Site Name, Site contact, Default web address, active site home page, inactive site home page.
  5. Once an organization has registered a domain name with a domain name registrar, it can point the url to sites url.
  6. Site template is a VisualForce page that defines the default look-and-feel of the sites page.
  7. Force.com sites are
    1. Public, unauthenticated websites
    2. Accessed from branded domain names
    3. Build with VF pages
    4. From data and content in a Salesforce application
  8. Creating a Force.com Site requires performing the following steps
    1. Build a Force.com App
    2. Design your web interface in visual force
    3. Create a Force.com site
    4. Activate the Force.com site
  9. Key concepts about Force.com Sites security
    1. Security for your site is controlled through public Access Settings
    2. Access can also be restricted by specifying an IP range.

VisualForce

  1. SalesForce provides two ways to build user interfaces. These are Page Builder and VisualForce. PageBuilder automatically generates pages with default look-and-feel. VisualForce allows developers to define their own user interface.
  2. VisualForce plays the role of JSP or ASP in SalesForce. It is used to develop user interface for SalesForce applications.
  3. Standard tags are included in VisualForce using apex keyword. As an example the top level tag in VisualForce is <apex:page>.Rest of the code is included in <apex:page>. Custom tags use tags use the prefix c:.
  4. The syntax to access fields in VisualForce is {!object.Field}. The expression in between {!} is evaluated. $User gives the details of the user that is logged in. {!$User.FirstName} displays the first name of the logged in user.
  5. A VisualForce page contains HTML, VisualForce components, JavaScript, Flash and text. All elements need to be well-formed. Visual Force gets converted into HTML at the server.
  6. VisualForce can be used to support other devices like phones, PDAs.
  7. <apex:inputfield value="{!account.name}"/> generates an input element. Based upon the data type of account,name field, appropriate user interface element is displayed (such as text box, pick list). This is an example of data binding. The value of the name field is displayed in the user interface, and changes are saved back to the object.
  8. <apex:form> is used to display a form. Other VisualForce display elements like text box, checkbox are included in a form.
  9. <apex:detail/> is used to print the details page for an object. If the attribute "relatedlist" is set to false, then related lists are not displayed. Specific related lists can be added using the VisualForce component <apex:relatedlist>
  10. VisualForce supports development mode. Development mode can be enabled using Setup|My Personal Information}Personal Information. In development mode, VisualForce provides two main features.
    1. Split screen development: In this the browser window is divided into two parts. The bottom part is used to show VisualForce code. Changes can be saved and resulting page is displayed on the same browser window.
    2. Creation of new pages by just typing the URL www.servername.com/apex/PageName where servername is the SalesForce server that is allocated to you.
  11. Page layouts support one or two columns. VisualForce can support more than two columns.
  12. Previous version of VisualForce is S-controls. It is now being phased out. Visual force two advantages over S-control
    1. Visual force having much better performance as compared to S - control.
    2. Visual force is a tag Markup language and S - controls are a javascript procedural code language.
  13. VisualForce components and pages have version numbers. SalesForce stores the version numbers along with pages. All older versions are supported.
  14. VisualForce elements take attributes similar to XML format. As an example in the statement below, sidebars and top headers are not displayed.
    <apex:page showHeader="false">
    </apex:page> 

    <apex:page> also takes an attribute renderAs as input which supports pdf generation.
  15. Record's id is sent via request parameter, and made available to the page. In the above example the id identifies the account for which name has to be displayed.
  16. VisualForce consists of three type of elements
    1. VisualForce pages: These are used to define the user interface. VisualForce pages support multiple devices
    2. VisualForce components: Standard prebuilt or custom user interface components available through a tag library
    3. VisualForce controllers:
  17. There are three type of controllers -
    Standard Controller
    The standard controllers provide access to standard Salesforce.com behavior.<:apex:page standardController="Account"> They are available for all API entities/objects, such as Account, Contact, Opportunity etc as well as custom objects. They Provide access to standard Salesforce data and behavior - Standard object record data and Standard actions like save, edit , delete.
    Custom Controller
    Custom Controllers is used for custom behavior or non-standard data-sets.<:apex:page controller="MyAccount"> They can be used to create wizards or leverage call outs.
    Controller Extensions
    Controller Extensions extend the behavior of standard controllers.<:apex:page standardController="Contact" extensions="ClassA, ClassB"> They are used to add custom behaviour or additional data to controllers






  18. Static resources are accessible through global variables $Resource. It can be used to access CSS stylesheets, images, flash movies and JavaScript libraries.






  19. Error messages are displayed in pageMessages component and can be displayed by the statement <apex:pageMessages/>






  20. To perform the save operation, the save() method can be invoked on the object. This is an example of action binding. <apex:commandButton value="Save" action={!save}"/>






  21. The look-and-feel of VisualForce is managed using StyleSheets. Default SalesForce look-and-feel can be changed.






  22. The size of VisualForce page cannot be more than 15MB.






  23. Web Services can also be invoked from VisualForce.






  24. Layout Editors

  25. Layout editor provides a drag-and-drop interface to define the user interface. Using Layout editor, fields of a page can be moved around, sections and space can be added.






  26. Layout editor supports one-column and two-column layout.






  27. Double-clicking on a field allows fields to be made read-only and required.