Creating Visualforce Pages in Salesforce | Techila
1314
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

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 Force.com 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

 

Description: http://www.techilaservices.com/techilla-oldsite/wp-content/uploads/2016/08/CreatingVisualforcePages.png

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

<apex:page>

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

This is your new page

</apex: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.

https://c.ap1.visual.force.com/apex/My First Visualforcepage.

 

Other way

Now I will explain second way to create visualforce page. Go to url and type /apex/pagename after visual.force.com

https://c.ap1.visual.force.com/apex/MyVFpage 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.

Description: http://www.techilaservices.com/techilla-oldsite/wp-content/uploads/2016/08/CreatingVisualforcePages1.png

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.

Description: http://www.techilaservices.com/techilla-oldsite/wp-content/uploads/2016/08/CreatingVisualforcePages2.png

Description: http://www.techilaservices.com/techilla-oldsite/wp-content/uploads/2016/08/CreatingVisualforcePages3.png

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(‘salesforce.com’,’force.com’)}</p>

</apex:page>

{!$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(‘salesforce.com’,’force.com’)} – It will display Boolean value based on the given condition

 

Courtesy:- http://www.salesforcetutorial.com/visualforce-creating-simple-page/

Author: techila

No Comments

Post A Comment