Creating Visualforce Pages in Salesforce | Techila
single,single-post,postid-1314,single-format-standard,ajax_updown_fade,page_not_loaded,,qode_grid_1300,footer_responsive_adv,hide_top_bar_on_mobile_header,qode-content-sidebar-responsive,qode-theme-ver-9.4.2,bridge,wpb-js-composer js-comp-ver-4.12,vc_responsive

Creating Visualforce Pages in Salesforce


Creating Visualforce Pages in Salesforce

Visualforce is very interesting framework in salesforce. It is a markup language you can use this to develop user interface according to your requirments in salesforce. Visualforce runs on platform. To design UI you can write visualforce pages and by using controller you can write business logic to your visualforce pages. In visualforce pages to write business logic we have these types of controller – A Standard controller- A Custom controller – A Controller extension we will discuss about these controllers later. Here I will give you a very simple example to create visualforce page. Will provide more information in later post. To create visualforce page go to Setup->Build-> Develop->Pages and click on new button. Enter required fields and you can write pages in specified section



In the above image you can write your page in red coloured marked space .


<h1>Welcome to salesforce</h1><br/>

This is your new page



Above snippet is a simple VF page. Here explain about this. Every page starts and ends with <apex:page> and  </apex:page> . To see the the output for above go to URL and type /apex/pagename. First Visualforcepage.


Other way

Now I will explain second way to create visualforce page. Go to url and type /apex/pagename after and click on enter

if the page is already available you will see output, If that page is not available, it will ask to create the page. See the below image for reference.


Click on link. The page will create and you can create that page and after saving you see output. See the below image for reference.



See the above image for reference. This option is available only when you enable developer mode at user level.

Below is the simple example, How to use simple formulas, functions n VF page.

<apex:page sidebar=”false” showHeader=”False”>

<h1>Hello “{!$User.LastName}“Welcome to salesforce </h1>

<p>Today’s Date is {!TODAY()} </p>

<p> Next week it will be {!TODAY()+7} </p>

<p> The year today is {YEAR(TODAY())}</p>

<p> Tomorrow will be day number {!DAY(TODAY())}</p>

<p>Let’s find a maximum:{!MAX(,1,2,3,4,5,6,5,4,3,2,1)}</p>

<p>The equare root of 49 is {!SQRT(49)}</p>

<p>Is it true? {! CONTAINS(‘’,’’)}</p>


{!$User.LastName} is simple formula. By using this formula we can get the user name. User is the standard object which stores user information in your salesforce org.


{!TODAY()} – It will display today date.

{!TODAY()+7} – It will display date after 7 days.

{YEAR(TODAY())} – It will display year of the day.

{!DAY(TODAY())} – It will display day of the today.

{!MAX(,1,2,3,4,5,6,5,4,3,2,1)} – It will display maximum number.

{!SQRT(49)} – It will display the square root of the given number.

{! CONTAINS(‘’,’’)} – It will display Boolean value based on the given condition



Author: techila

No Comments

Post A Comment