Salesforce - Variables & Formulas


Advertisements

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.

Visualforce variables expressions

On previewing the output, we get the following details.

Visualforce variables expressions2

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

Visualforce variables expressions3

On previewing the output, we get the following details.

Visualforce variables expressions4

Useful Video Courses


Video

Salesforce Online Training

49 Lectures 3.5 hours

Manigandan Jagadeesan

Video

Salesforce Certified Administration

113 Lectures 13 hours

Eduonix Learning Solutions

Video

A Practical Guide To SFDX and Salesforce CLI

37 Lectures 3 hours

Manish Choudhari

Video

Cloud Computing with SALESFORCE HEROKU

22 Lectures 4.5 hours

Pranjal Srivastava

Video

Salesforce Report and Dashboard

43 Lectures 7 hours

Debasis Jena

Video

Salesforce Lightning Components Development Tutorial

54 Lectures 8 hours

SYED CHAND SHAH

Advertisements