Salesforce – Variables & Formulas

salesforce variables  formulas

In this guide we will discuss about variables and formulas in Salesforce. The data from the Salesforce objects can be brought into the Visualforce page using variables and expressions. Like other normal programming language, the Visualforce language has expressions, operators and literals, etc. The basic building block of this language is expressions.

The syntax of a Visualforce expression is as below.

{! expression }

Example

Let us use the global variable $user. We can write the following code to get the username, First name and login name.

vf variables expressions

On previewing the output, we get the following details.

vf variables expressions 2

Similarly, we can use many other variables and manipulate them using formula as shown in the code below.

vf variables expression3

On previewing the output, we get the following details.

salesforce variables formulas vf variables expressions 4

Next Topic : Click Here

This Post Has One Comment

Leave a Reply