This document discusses the transition from classic Salesforce development to Lightning development. It begins by covering mobile SDK development and Salesforce Mobile Classic. It then discusses Salesforce Lightning and the key differences between classic and Lightning development approaches. Some of the main reasons provided to switch to Lightning include reducing development effort, compatibility with different devices, and a component-based event-driven architecture. The document proceeds to explain Lightning components and events, providing an example of how events can be used to communicate between components. It concludes by sharing links to a GitHub repo and package for demonstrating Lightning events.
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Journey from classic Salesforce development to lightning Developmemt
1. Journey from Classic Salesforce Development to Lightning
Development
Sunil Kumar
7x Salesforce Certified | Developer | Blogger
@sunil02kumar
Blog: https://sunil02kumar.blogspot.in
@sunil02kumar
2. Agenda
@sunil02kumar
Mobile SDK Development
Salesforce Mobile Classic
Salesforce Lightning
Difference between Salesforce Classic Development
and Lightning
Reasons to Switch to Salesforce Lightning
Understanding Lightning Components
Lightning Events
Raising and Handling custom events in Lightning
Demo
Q&A
3. Mobile SDK Development
@sunil02kumar
Salesforce Mobile SDK gives developers the tools to build mobile applications with customized user
experiences.
This allows you to create your own app and distribute it through Google Play Store or Apple App
Store
4. Salesforce Mobile Classic
@sunil02kumar
Salesforce Mobile Classic gives you mobile access to your Salesforce data, tasks, and calendar, and
integrates the data with your mail and phone
Offline capabilities.
Salesforce Mobile Classic data is defined by a mobile configuration created by your administrator,
who identifies which objects, records, and specific fields are relevant to your daily work needs.
Allows users to view, edit, and delete the records stored on your device, or create new records.
A separate Salesforce Mobile Classic license is required for each user who uses a mobile device to
access Salesforce.
Visualforce Tabs and Web Tabs can be access only if device is connected to internet because the
tabs are launched in an embedded browser.
6. Difference between Salesforce Classic Development and
Lightning
@sunil02kumar
Modal
(Objects)
View
(VF Pages & VF
Components)
Controller
(Apex)
Modal
(Objects)
View
(Lightning
Components)
Client Side Controller
(.js file)
Server Side Controller
(Apex)
7. Reasons to Switch to Salesforce Lightning
@sunil02kumar
Reduce Development Effort
Compatible with different devices
Component based and Event driven
architecture
Compatible with Salesforce new releases
9. Lightning Events
@sunil02kumar
Event acts as channel to communicate between components.
Events are usually triggered by a user action
Events can contain attributes that can be set before the
event is fired and read when the event is handled.
Component which register for event can send information
through controller.
Component specifying handler for event can read information
passed by other event.
10. @sunil02kumar
Event- carAccident
Notifier- Fire Event
Hospital- Event Handler
Fire Event – Calling
Hospital
carAccident.evt
<aura:event type="COMPONENT" description="Event template" >
<aura:attribute name="msg" type="String" access="GLOBAL"/>
</aura:event>
carAccidentNotifier.cmp
<aura:component >
<aura:registerEvent name="newCarAccident" type="c:carAccident"/>
<h1>Car Accident Example</h1>
<ui:button label="Accident Took Place"
press="{!c. fireCarAccidentEvent }"/>
</aura:component>
carAccidentNotifierController.js
({
fireCarAccidentEvent : function(component, event, helper) {
var accidentEvent = component.getEvent("newCarAccident");
accidentEvent.setParams({"msg":"there is car Accident. Send
ambulance."});
accidentEvent.fire();
}
})
CarAccidentHandler.cmp
<aura:component >
<aura:attribute name="msgFromNotifier" type="String"/>
<!-- same name as that of notifier registerEvent name attribute -->
<aura:handler name="newCarAccident" event="c:carAccident"
action="{!c.handleNotification}"/>
<!-- Handler should contains notifier component-->
<c:carAccidentNotifier />
<div>message from Notifier : <b>{!v.msgFromNotifier}</b></div>
</aura:component>
CarAccidentHandlerController.js
({
handleNotification : function(component, event,
helper){
var sentMessage= event.getParam("msg");
component.set("v.msgFromNotifier",
sentMessage);
}
})
Raising and Handling custom events in Lightning