Date post: | 21-Jan-2018 |
Category: |
Education |
Upload: | sunil-kumar |
View: | 1,033 times |
Download: | 0 times |
Journey from Classic Salesforce Development to Lightning
Development
Sunil Kumar
7x Salesforce Certified | Developer | Blogger
@sunil02kumar
Blog: https://sunil02kumar.blogspot.in
@sunil02kumar
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
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
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.
Salesforce Lightning
@sunil02kumar
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)
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
Understanding Lightning Components
@sunil02kumar
Attributes which
controls the
data on UI
Contains
controller.js and
helper.js
@AuraEnabled
static methods
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.
@sunil02kumar
Event- carAccident
Notifier- Fire Event
Hospital- Event HandlerFire 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
@sunil02kumar
Demo
Github Repo URL:
https://github.com/Sunil02kumar/Lightning-Events-Demo-Code_PUG
Short URL - https://goo.gl/EwhzWd
Unmanaged Package Installation URL:
https://login.salesforce.com/packaging/installPackage.apexp?p0=04t900000002eC6
Short URL- https://goo.gl/SMao1o
@sunil02kumar
@sunil02kumar