View Count

Saturday, March 1, 2014

Introduction to Visualforce --1

As a Salesforce developer you will face numerous occassions when the users demand custom pages or something different than what Salesforce's native environment has to offer. How do you cater to such situations. Just say 'No Problemo...' and start working on developing Visualforce pages. You can develop custom user interfaces using two ways. One by using Visualforce Components framework or use the automatically generated Page Layouts that Salesforce environment provides.

Lets start with our Visualforce jouney. Note that this will be a series of blogs based on Visualforce and Apex. (Its not possible to cover all topics in a single blog). This blog will give you a brief introduction on Visualforce. Visualforce is basically a component based framework to build custom pages. This framework uses tags to build components that make up a page. There are about 70 components which are already made available by the salesforce framework. But that doesn't mean that you cannot create your own component. The framework allows developers to create custom components.

Visualforce also follows the MVC(Model View Controller) paradigm. Hence the VF (henceforth Visualforce is referred to as VF) pages provide tight integration with the Salesforce database.
Now lets take a deeper look at how VF pages are built and rendered. Visualforce pages are made up of components (custom or already available). These components basically render HTML tags when called from the browser. Once the VF pages are constructed and saved in the salesforce servers the users can access those pages using url links in the browser. The interesting part starts now. When a call is made to the Salesforce servers for those pages, the VF tags are rendered as HTML tags instead and an HTML page is displayed at the browser. (Your browser has no clue how to interpret VF tags). You might wonder why do we need to build VF pages using VF tags then? Don't the HTML tags serve the purpose. Yes, HTML tags serve the purpose and you can very well substitute HTML tags to VF tags. But the main advantage of using VF tags is it reduces the amount of code that needs to be written by about 90%. No wonder Salesforce Developers go gaga about Visualforce and Apex Development platform.  This process is explained in the image above.

Now since you know what Visualforce pages are all about (and I hope you are hungry for more). Lets stop it here and we will continue in the next blog post.

No comments: