Getting Started with JavaScript in Salesforce

A lot of JavaScript training is designed for general use on web applications, node.js, or various frameworks. In this course, you'll learn JavaScript from a Salesforce point of view - with coverage of both Lightning Components and Visualforce.
Course info
Rating
(40)
Level
Beginner
Updated
Jan 24, 2017
Duration
2h 18m
Table of contents
Course Overview
Understanding the Landscape: How User Interfaces Work
Introducing JavaScript Data Types and Language Features
Discovering JavaScript Objects - They're Everywhere!
Exploring JavaScript in Classic Mode and Visualforce
Exploring JavaScript in Lightning Experience and Components
Moving Forward - Advanced Concepts
Description
Course info
Rating
(40)
Level
Beginner
Updated
Jan 24, 2017
Duration
2h 18m
Description

JavaScript has always been available to Salesforce developers, but with the appearance of Lightning, it is now a first class language on the platform. That means it's time for every Salesforce developer to learn JavaScript. This course, Getting Started with JavaScript in Salesforce, will show you how to leverage your knowledge of Apex and Salesforce to become a JavaScript master. First you'll learn about how the user interfaces work as well as what JavaScript data types and language features are. Next, you'll explore JavaScript objects and JavaScript in both classic mode and Visualforce. Finally, you'll wrap up this course by learning about JavaScript in Lightning and learn about a selection of advanced concepts. By the end of this course, you'll have a strong understanding of the fundamentals of JavaScript and be able to understand and develop JavaScript applications in Visualforce and Lightning.

About the author
About the author

Dan Appleman is a well known author, software developer, and speaker. Currently the CTO of Full Circle Insights, he is the author of numerous books, ebooks, and online courses on various topics (technology and other). His latest book is "Advanced Apex Programming" - advancedapex.com Personal Website http://danappleman.com.

More from the author
More courses by Dan Appleman
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
JavaScript has always been available to Salesforce developers building Visualforce pages, but with the transition to Lightning, JavaScript has truly become a first-class language on the platform. Most of the material that teaches Lightning focuses on the framework, assuming that students will just pick up JavaScript as they go along. But for all the JavaScript looks a bit like Apex, it's very different, and to use it properly you need understanding beyond what you'll get from looking at examples from the Lightning documentation and trailhead. There's a lot of JavaScript training material available, but it's designed for general use on web applications, Node. js, or various frameworks, and some of the processes, techniques, and design patterns just aren't applicable to Salesforce. What Salesforce developers really need is JavaScript training designed for the Salesforce platform, both Visualforce and Lightning. That's what this course is all about. By the time you're finished, you'll have a strong understanding of the fundamentals of JavaScript and be able to understand and to develop JavaScript applications in Visualforce and Lightning.

Introducing JavaScript Data Types and Language Features
In the previous module, I noted that this course is not intended to teach beginning programming, that I assume you already have some programming experience in another language. Since this course is about JavaScript in Salesforce, it only makes sense to use Apex as the other language as we begin to explore JavaScript. As you'll soon see, JavaScript may look a lot like Apex, but it's very, very different. We'll start out this module by looking at primitives, the simplest type of variable. We'll look at how to declare them, and the key operators and methods that you'll be using. Then we'll move onto to some of the core language syntax, avoiding for the moment all discussion on objects and functions, topics that will be covered in the next module.

Exploring JavaScript in Classic Mode and Visualforce
With all the excitement and focus on the Lightning experience, you might wonder why I'm starting with JavaScript in Visualforce, classic Salesforce. There are a number of reasons. First, Visualforce isn't going away any time soon, there's just too much infrastructure built on Visualforce for it to ever go away. Next, Visualforce pages can be hosted in the Lightning experience; that allows Lightning to leverage existing Visualforce pages, and it allows you to take advantage of the Visualforce security model, which is different, and in some ways more flexible than the Lightning component model. But perhaps the most important reason to start with looking at JavaScript in Visualforce is that Visualforce is a very traditional kind of web application, that by default does not use any JavaScript framework. So it allows us to focus on the JavaScript and its relationship to HTML and the DOM, instead of having to factor in a framework, that makes it a great starting point. For the examples in this module, we'll use a custom object called Student that is the sObject version of the one described in module 3. The Student class we defined earlier in Apex is still around, but since this is a database object, it will have the API name of Student__c. The object has the First Name, Last Name, Age, GPA, and Applied For Financial Aid fields, as shown here. I've also created a Custom Object Tab to make it easy to access the object. I'm not going to walk you through the creation of the object and its associated tab, in the unlikely event that you're not familiar with the creation of custom objects in Salesforce, please refer to the Salesforce online documentation trailhead beginning Salesforce courses here on Pluralsight, or a friendly Salesforce admin.