Variables & Formulas in Salesforce

Last updated on Nov 24 2021
VRamamoorthy R

Table of Contents

Variables & Formulas in Salesforce

The data from the Salesforce objects are often brought into the Visualforce page using variables and expressions. Like other normal programing language, the Visualforce language has expressions, operators and literals, etc. the essential building block of this language is expressions.
The syntax of a Visualforce expression is as below.
{! expression }

Example

Let us use the worldwide variable $user. we will write the subsequent code to urge the username, given name and login name.

Variables & Formulas in Salesforce
Variables & Formulas in Salesforce

On previewing the output, we get the subsequent details.

Get Started with Salesforce - Environment
Variables & Formulas in Salesforce

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

Variables & Formulas in Salesforce
Variables & Formulas in Salesforce

On previewing the output, we get the subsequent details.

Variables & Formulas in Salesforce
Variables & Formulas in Salesforce

Salesforce – Standard Controllers

Visualforce consists of the many built-in controllers which may be wont to access and display data. It works on the MVC (model-view-controller) approach. The controllers interact with the info base and pull the info from the database to look at the data through a webpage created by apex page.
To display a selected record or group of records, we’d like the record ID. When integrated with other Visualforce pages the ID can flow to the controller page automatically. But during a standalone page we’d like to specify the record ID manually to ascertain the controller working.

Example

Let us create a Visualforce page to urge the summary of a record within the Contact object. to try to to this, we use the component called standard Controller and put it in an apex block. The diagram given below shows the code to realize this.

Variables & Formulas in Salesforce
Variables & Formulas in Salesforce

Here we display some select fields from the thing. they’re Name, Email and phone. If we attend the Preview window, we discover that the page only displays the labels but no data. that’s because we’ve not associated the result from the controller with any specific record.
So next we identify a record form the Contact Object to be attached to the result from the controller. Open the contacts object and click on any of contact name. it’ll open the subsequent window from which we capture the ID of the record. The ID is highlighted within the URL. In your environment, it’ll be an identical string of characters.

Variables & Formulas in Salesforce
Variables & Formulas in Salesforce

Finally, we add this ID of the record to the URL of the preview window of the Visualforce standard controller page we created. within the current example, the ID of the record is added as shown below.
https://c.ap2.visual.force.com/apex/FirstPage?core.apexpages.request.devconsole=1&id=0032800000Wih9kAAB

Variables & Formulas in Salesforce
Variables & Formulas in Salesforce

On visiting the above URL from the Organization’s salesforce account, we get the small print of the record as shown below.

So, this brings us to the end of blog. This Tecklearn ‘Variables & Formulas in Salesforce’ blog helps you with commonly asked questions if you are looking out for a job in Salesforce. If you wish to learn Salesforce and build a career in Salesforce domain, then check out our interactive, Salesforce Certification Training: Admin 201 and App Builder, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

Salesforce Certification Training: Admin 201 and App Builder

Salesforce Certification Training: Admin 201 and App Builder

About the Course

Salesforce Certification Training course will help you pass the Salesforce Administrator Exam (Admin 201) and the Salesforce App Builder (Dev 401) Exam. Concepts on Force.com Platform, AppExchange, SFDC Security Model, Service Cloud, Sales Cloud, Lightning App Builder, Salesforce Reports & Dashboard can be mastered in this Salesforce Training course. You can also configure the platform, manage users, find better ways to use the platform’s features, build applications with Salesforce Lightning, and more. Further, in this Salesforce certification training course, you will master App builder, Apex, Visualforce, etc.

Why Should you take Salesforce Admin 201 and App Builder Training?

• As per Indeed.com data, 200% global jump in Salesforce jobs since Jan 2016. Salesforce Certified Administrators earn an annual average salary of $87,000 but can go as high as $160,000 depending on their knowledge, skills, and experience.
• More than 200,000 companies worldwide use Salesforce platform. Salesforce leads the CRM market with 19.5 percent of market share – Forbes.
• The global CRM software market will reach US$40.26 billion in 2023, up from US$36.9 billion (2020) – Statista.

What you will Learn in this Course?

Salesforce Fundamentals

• Introduction to CRM concepts and Cloud computing
• Salesforce.com Overview and Fundamentals
• Understanding Salesforce Platform

Understanding Salesforce Platform

• Understanding Salesforce Terminologies and Introducing the force.com platform
• Understanding Salesforce Metadata and API
• Describe the capabilities of the core CRM objects in the Salesforce schema
• Identify common scenarios for extending an org using the AppExchange
• About Salesforce Certification

Introduction to Sales Cloud

• Sales Cloud
• Sales Process
• Sales Productivity Features
• Lead Management
• Lead auto response
• Lead assignment
• Web to lead
• Accounts and Contacts Management
• Opportunities
• Campaign Management

Security Model, User Management and Its Features

• Security Model Mind Map
• System Level or Org Level Security
• User Administration and Troubleshooting
• Permission Sets
• Profile Management
• User Actions
• Assigning Permission
• Session settings
• Activations
• Page layout assignment
• Tab setting
• Field level security

Object, Record and Field Level Features

• Custom Object
• Custom Field
• Data Types
• Relationship among Objects
• Working with App and Tabs

Data Handling and Processing

• Data Import and Export with Salesforce
• Insert, Update and Delete Data with Salesforce
• Export Data with UI
• Export Data using Data Loader Tool

Deployment

• SandBox
• Moving Data from SB to Production – Deployment
• Types of SandBox
• Change Sets
• Types of Change Sets

Application Cycle

• Milestones
• Sandboxes
• Change Sets
• Packages

Reports and Dashboards

Declarative Implementation in Salesforce

Salesforce Development and Apex Programming

• Apex Programming
• Apex Classes
• Apex Settings
• SOQL – Salesforce Object Query Language
• DML Commands
• Apex Class in Detail
• Apex Triggers
• Apex Testing
• Access Specifier in Salesforce
• Testing

Lightning in Salesforce

• Lightning Components
• Lightning Component Capabilities
• Lightning Components vs. Visualforce

Visual Force in Salesforce

• Standard Visualforce controller and controller extensions,
• Visualforce Page
• Understanding the MVC Pattern
• Tools for Visualforce Development
• Visual Force Components

WorkFlows in Salesforce

• Work Flows in Salesforce
• Types of Work Flows
• Work Flows Rules

About Preparation of Salesforce 201 and App Builder Certification exams

Got a question for us? Please mention it in the comments section and we will get back to you.

0 responses on "Variables & Formulas in Salesforce"

Leave a Message

Your email address will not be published. Required fields are marked *