SlideShare a Scribd company logo
1 of 8
Download to read offline
SALESFORCE
LIGHTNING-
HELPFUL TIPS
& TRICKS
Did you know that Aura Id does not allow dynamic values?
aura:id cannot be allocated dynamically because aura:id doesn't
support expressions.
For ex: The below is not allowed
One can only assign literal string values to aura:id.
$<ui:inputText aura:id="{!v.index + '_sample'}"/>
Setting a value to an element using aura:id
For ex:
.cmp
<ui:inputText aura:id="sampleAura"/>
.js
component.find("sampleAura").set("v.value","Some Value“)
Lightning utility function to check whether an attribute is defined or not.
OOB utility method to check whether the attribute is undefined or not
$A.util.isUndefined(component.get("v.someData“)
Cache Elements in jQuery to load the Lightning Page faster
For better performance one should reduce the DOM touches as
much as possible. So it's a good idea to cache the jQuery
objects. To cache an element just assign it into a variable for
later use.
<script type="text/javascript">
var $element = $('#selector');
if ($element.is(':hidden')) {
$element.addClass('active').show();
$element.data("custom", "abc123");
}
//some other code
$element.hide();
</script>
Loading dependent JS files in sequence.
Facing JS dependencies error in lightning might be because of
required prerequisite file is not loaded first for ex: jQuery
Instead of loading files individually. For ex –
The dependent files should be loaded in the desired sequence.
For ex –
<ltng:require scripts="/resource/jquery" />
<ltng:require scripts="/resource/datatable.js"/>
<ltng:require scripts="/resource/jquery,/resource/datatable.js" />
Understanding the 'c' and 'v' conventions in lightning component.
c stands for controller which includes both Client side js controller and server-side Apex controller
Referenced as "{!c.doSomething}"in an expression in the mark-up or as component.get("c.getSomething") from JavaScript.
v is the view, the most common use of "v" is to access the attributes on the component, as in expressions with "{!v.someAttribute}" or in
JavaScript with component.get("v.someAttribute").
Calling JS function once pre-requisites JS are loaded.
Initiating a call once the JS required files are loaded:
.cmp
<ltng:require scripts="/resource/jquery" afterScriptsLoaded="{!c.setup}" />
.js
({
setup : function(component, event, helper) {
//do something here
}
})
Calling JS method on component load in lightning.
.cmp
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
.js
doInit: function(component, event, helper) {
//do something
}
Fix the issue of overridden css when ui:button is used together with SLDS
Calling JS function on button click, but don't want to use ui:button because of conflicting design compared to SLDS.
JS function can be called using press attribute on button. For ex –
Similarly it can be achieved on button tag using onclick attribute-
<ui:button aura:id="button" label="Click me" press="{!c.callFunction}"/>
<button class="slds-button" onclick="{!c.callFunction}">Click Me</button>
Unable to find your custom component in
Lightning App Builder?
To be accessible in the Lightning App Builder or a Lightning Page, a
component must implement the flexipage:availableForAllPageTypes
interface
<aura:component implements="flexipage:availableForAllPageTypes">
</aura:component>
Getting the record ID in custom lightning record pages.
In order to access the recordI ID, force:hasRecordId has to be
implemented in lightning component
Note - An attribute named as recordId will be generated automatically
when hasRecordId is implemented.
.cmp
<aura:component implements="force:hasRecordId">
</aura:component>
Record Id can be accessed directly in cmp using expression {!v.recordId}
In JS it can be accessed by component.get("v.recordId")
Would you like to bind events with your lightning icons?
Use lightning:buttonIcon - an icon-only HTML button
A lightning:buttonIcon component represents an icon-only button element that executes an action in a controller. JS events can be bound to the co
mponent.
For Clicking the button triggers the client-side controller method set for onclick.
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_lightning_buttonIcon.htm
If you would like to use Sprited icon, svgIcon component has to be replicated as Sprited non-inline SVGs are not supported in
Lightning yet https://www.lightningdesignsystem.com/resources/lightning-svg-icon-component-helper/
Selecting an element with .(dot) in its ID in Lightning.
The backslash should be used in the selector to select the
element having period in its ID.
The way to use CSS in Lightning components.
Components should take up 100% of whatever container they
display in.
Adding a left or right margin changes the width of a
component and can break the layout of the page.
Some CSS rules remove the HTML element from the flow of the
document.
For example:
if you want to set some size that go for grid system rather
than defining it in CSS
Minimizing DOM Manipulation in Visualforce/Lightning
Common ways to improve jQuery performance are by compressing the scripts and limiting DOM manipulation as much as possible.
Consider the following piece of code that appends a DOM Can be replace with a more efficient code to minimize DOM
Manipulation inside a loop manipulation
$("#some.ContentID").val();
float: left;
float: right;
position: absolute;
position: fixed;
for (var count=0; count<=rows.length; count++)
{
$('#tableObject').append('<tr><td>'+rows[count]+'</td></tr>');
}
var str = '';
for (var count=0; count<=rows.length; count++)
{
str += '<tr><td>'+rows[count]+'</td></tr>';
}
$('#tableObject').append(str);
Zen4orce Service Offerings
jQuery
SALESFORCE CUSTOMIZATION
SALESFORCE AUTOMATION
ADVISORY SERVICES
INTEGRATED SOLUTIONS
Lightning
Bootstrap
Visualforce
Appexchange Communities
Service
Cloud
Sales Cloud
GitHub
Apex
Web
Services
Visit www.zen4orce.com for further details about Zen4orce Services & Offerings.
Skillset
Salesforce Lightning Tips & Tricks

More Related Content

What's hot

Building API in the cloud using Azure Functions
Building API in the cloud using Azure FunctionsBuilding API in the cloud using Azure Functions
Building API in the cloud using Azure FunctionsAleksandar Bozinovski
 
Access to User Activities - Activity Platform APIs
Access to User Activities - Activity Platform APIsAccess to User Activities - Activity Platform APIs
Access to User Activities - Activity Platform APIsAtlassian
 
Appear IQ - Tutorials Backbone.js
Appear IQ - Tutorials Backbone.jsAppear IQ - Tutorials Backbone.js
Appear IQ - Tutorials Backbone.jsAppear
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life CycleAbhishek Sur
 
Adding User Management to Node.js
Adding User Management to Node.jsAdding User Management to Node.js
Adding User Management to Node.jsDev_Events
 
Ajax control tool kit
Ajax control tool kitAjax control tool kit
Ajax control tool kitVidhi Patel
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMohammad Shaker
 
Supercharge Your Pages - New Ways to Extend the Confluence Editor
Supercharge Your Pages - New Ways to Extend the Confluence EditorSupercharge Your Pages - New Ways to Extend the Confluence Editor
Supercharge Your Pages - New Ways to Extend the Confluence EditorAtlassian
 
Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...Sunil kumar Mohanty
 
Creating a Symfony Ecommerce App
Creating a Symfony Ecommerce AppCreating a Symfony Ecommerce App
Creating a Symfony Ecommerce AppMuhammad Azaz Qadir
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365Luis Valencia
 
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.Mohammad Shaker
 
StackMob & Appcelerator Module Part One
StackMob & Appcelerator Module Part OneStackMob & Appcelerator Module Part One
StackMob & Appcelerator Module Part OneAaron Saunders
 
Angular 7 Firebase5 CRUD Operations with Reactive Forms
Angular 7 Firebase5 CRUD Operations with Reactive FormsAngular 7 Firebase5 CRUD Operations with Reactive Forms
Angular 7 Firebase5 CRUD Operations with Reactive FormsDigamber Singh
 
What is new in Firebase?
What is new in Firebase?What is new in Firebase?
What is new in Firebase?Sinan Yılmaz
 

What's hot (20)

Web controls
Web controlsWeb controls
Web controls
 
Building API in the cloud using Azure Functions
Building API in the cloud using Azure FunctionsBuilding API in the cloud using Azure Functions
Building API in the cloud using Azure Functions
 
Access to User Activities - Activity Platform APIs
Access to User Activities - Activity Platform APIsAccess to User Activities - Activity Platform APIs
Access to User Activities - Activity Platform APIs
 
Appear IQ - Tutorials Backbone.js
Appear IQ - Tutorials Backbone.jsAppear IQ - Tutorials Backbone.js
Appear IQ - Tutorials Backbone.js
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
Adding User Management to Node.js
Adding User Management to Node.jsAdding User Management to Node.js
Adding User Management to Node.js
 
Ajax control tool kit
Ajax control tool kitAjax control tool kit
Ajax control tool kit
 
Ajax
AjaxAjax
Ajax
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
 
Supercharge Your Pages - New Ways to Extend the Confluence Editor
Supercharge Your Pages - New Ways to Extend the Confluence EditorSupercharge Your Pages - New Ways to Extend the Confluence Editor
Supercharge Your Pages - New Ways to Extend the Confluence Editor
 
Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...
 
Creating a Symfony Ecommerce App
Creating a Symfony Ecommerce AppCreating a Symfony Ecommerce App
Creating a Symfony Ecommerce App
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365
 
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
 
StackMob & Appcelerator Module Part One
StackMob & Appcelerator Module Part OneStackMob & Appcelerator Module Part One
StackMob & Appcelerator Module Part One
 
Angular 7 Firebase5 CRUD Operations with Reactive Forms
Angular 7 Firebase5 CRUD Operations with Reactive FormsAngular 7 Firebase5 CRUD Operations with Reactive Forms
Angular 7 Firebase5 CRUD Operations with Reactive Forms
 
Android dev tips
Android dev tipsAndroid dev tips
Android dev tips
 
Ajax and ASP.NET AJAX
Ajax and ASP.NET AJAXAjax and ASP.NET AJAX
Ajax and ASP.NET AJAX
 
What is new in Firebase?
What is new in Firebase?What is new in Firebase?
What is new in Firebase?
 

Viewers also liked

How to Get Started with Salesforce Lightning
How to Get Started with Salesforce LightningHow to Get Started with Salesforce Lightning
How to Get Started with Salesforce LightningSalesforce Admins
 
What is Salesforce lighting explained
What is Salesforce lighting explainedWhat is Salesforce lighting explained
What is Salesforce lighting explainedRoy Gilad
 
Salesforce Lightning Experience Overview by Brainiate
Salesforce Lightning Experience Overview by BrainiateSalesforce Lightning Experience Overview by Brainiate
Salesforce Lightning Experience Overview by Brainiatebrainiate
 
Introducing the Salesforce Lightning Design System
Introducing the Salesforce Lightning Design SystemIntroducing the Salesforce Lightning Design System
Introducing the Salesforce Lightning Design SystemSalesforce Developers
 
Build Next-gen Apps Faster with Lightning Components
Build Next-gen Apps Faster with Lightning ComponentsBuild Next-gen Apps Faster with Lightning Components
Build Next-gen Apps Faster with Lightning ComponentsSalesforce Developers
 
Designing for the Salesforce Platform
Designing for the Salesforce Platform Designing for the Salesforce Platform
Designing for the Salesforce Platform AaronRich1
 
The Lightning Process Builder and the Growing Role of the Salesforce Admin
The Lightning Process Builder and the Growing Role of the Salesforce AdminThe Lightning Process Builder and the Growing Role of the Salesforce Admin
The Lightning Process Builder and the Growing Role of the Salesforce AdminSalesforce Admins
 
How to Prepare Yourself and Your Org for a Salesforce Release by Ted Hazard
How to Prepare Yourself and Your Org for a Salesforce Release by Ted Hazard How to Prepare Yourself and Your Org for a Salesforce Release by Ted Hazard
How to Prepare Yourself and Your Org for a Salesforce Release by Ted Hazard Salesforce Admins
 
Connecticut Salesforce Developer Group - Jan 2017
Connecticut Salesforce Developer Group - Jan 2017Connecticut Salesforce Developer Group - Jan 2017
Connecticut Salesforce Developer Group - Jan 2017Jitendra Zaa
 
Getting VMs in Shape with data-driven workflows in CA Process Automation
Getting VMs in Shape with data-driven workflows in CA Process AutomationGetting VMs in Shape with data-driven workflows in CA Process Automation
Getting VMs in Shape with data-driven workflows in CA Process AutomationCA Technologies
 
Managing change in an agile Salesforce development environment
Managing change in an agile Salesforce development environmentManaging change in an agile Salesforce development environment
Managing change in an agile Salesforce development environmentRoland Bullivant
 
Cover Letter and Resume
Cover Letter and ResumeCover Letter and Resume
Cover Letter and ResumeCedric Wang
 
Customer Stories Submission Process for Cloud Alliance Partners
Customer Stories Submission Process for Cloud Alliance Partners Customer Stories Submission Process for Cloud Alliance Partners
Customer Stories Submission Process for Cloud Alliance Partners Salesforce Partners
 
synebo talk #1 Salesforce lightning
synebo talk #1 Salesforce lightningsynebo talk #1 Salesforce lightning
synebo talk #1 Salesforce lightningAnna Kryvulya
 
Lightning And Thunder
Lightning And ThunderLightning And Thunder
Lightning And Thunderflynn1pw
 
Make Your App Lightning Ready with Winter '17 (December 8, 2016)
Make Your App Lightning Ready with Winter '17 (December 8, 2016)Make Your App Lightning Ready with Winter '17 (December 8, 2016)
Make Your App Lightning Ready with Winter '17 (December 8, 2016)Salesforce Partners
 

Viewers also liked (20)

Salesforce Lightning workshop
Salesforce Lightning workshopSalesforce Lightning workshop
Salesforce Lightning workshop
 
How to Get Started with Salesforce Lightning
How to Get Started with Salesforce LightningHow to Get Started with Salesforce Lightning
How to Get Started with Salesforce Lightning
 
What is Salesforce lighting explained
What is Salesforce lighting explainedWhat is Salesforce lighting explained
What is Salesforce lighting explained
 
Salesforce Lightning Experience Overview by Brainiate
Salesforce Lightning Experience Overview by BrainiateSalesforce Lightning Experience Overview by Brainiate
Salesforce Lightning Experience Overview by Brainiate
 
Introducing the Salesforce Lightning Design System
Introducing the Salesforce Lightning Design SystemIntroducing the Salesforce Lightning Design System
Introducing the Salesforce Lightning Design System
 
Build Next-gen Apps Faster with Lightning Components
Build Next-gen Apps Faster with Lightning ComponentsBuild Next-gen Apps Faster with Lightning Components
Build Next-gen Apps Faster with Lightning Components
 
Workplace Emergency Response Plans
Workplace Emergency Response PlansWorkplace Emergency Response Plans
Workplace Emergency Response Plans
 
Designing for the Salesforce Platform
Designing for the Salesforce Platform Designing for the Salesforce Platform
Designing for the Salesforce Platform
 
The Lightning Process Builder and the Growing Role of the Salesforce Admin
The Lightning Process Builder and the Growing Role of the Salesforce AdminThe Lightning Process Builder and the Growing Role of the Salesforce Admin
The Lightning Process Builder and the Growing Role of the Salesforce Admin
 
Employee review phrases
Employee review phrasesEmployee review phrases
Employee review phrases
 
How to Prepare Yourself and Your Org for a Salesforce Release by Ted Hazard
How to Prepare Yourself and Your Org for a Salesforce Release by Ted Hazard How to Prepare Yourself and Your Org for a Salesforce Release by Ted Hazard
How to Prepare Yourself and Your Org for a Salesforce Release by Ted Hazard
 
Connecticut Salesforce Developer Group - Jan 2017
Connecticut Salesforce Developer Group - Jan 2017Connecticut Salesforce Developer Group - Jan 2017
Connecticut Salesforce Developer Group - Jan 2017
 
Getting VMs in Shape with data-driven workflows in CA Process Automation
Getting VMs in Shape with data-driven workflows in CA Process AutomationGetting VMs in Shape with data-driven workflows in CA Process Automation
Getting VMs in Shape with data-driven workflows in CA Process Automation
 
Managing change in an agile Salesforce development environment
Managing change in an agile Salesforce development environmentManaging change in an agile Salesforce development environment
Managing change in an agile Salesforce development environment
 
Cover Letter and Resume
Cover Letter and ResumeCover Letter and Resume
Cover Letter and Resume
 
Lightning Components Workshop
Lightning Components WorkshopLightning Components Workshop
Lightning Components Workshop
 
Customer Stories Submission Process for Cloud Alliance Partners
Customer Stories Submission Process for Cloud Alliance Partners Customer Stories Submission Process for Cloud Alliance Partners
Customer Stories Submission Process for Cloud Alliance Partners
 
synebo talk #1 Salesforce lightning
synebo talk #1 Salesforce lightningsynebo talk #1 Salesforce lightning
synebo talk #1 Salesforce lightning
 
Lightning And Thunder
Lightning And ThunderLightning And Thunder
Lightning And Thunder
 
Make Your App Lightning Ready with Winter '17 (December 8, 2016)
Make Your App Lightning Ready with Winter '17 (December 8, 2016)Make Your App Lightning Ready with Winter '17 (December 8, 2016)
Make Your App Lightning Ready with Winter '17 (December 8, 2016)
 

Similar to Salesforce Lightning Tips & Tricks

Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptWalid Ashraf
 
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinWill your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinBarry Gervin
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event HandlingWebStackAcademy
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlIlia Idakiev
 
Flex Building User Interface Components
Flex Building User Interface ComponentsFlex Building User Interface Components
Flex Building User Interface ComponentsAhmad Hamid
 
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...Uniface
 
Devoxx 09 (Belgium)
Devoxx 09 (Belgium)Devoxx 09 (Belgium)
Devoxx 09 (Belgium)Roger Kitain
 
Lightning salesforce
Lightning salesforceLightning salesforce
Lightning salesforcemounikadv
 
JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)Roger Kitain
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e bigAndy Peterson
 
Animation And Testing In AngularJS
Animation And Testing In AngularJSAnimation And Testing In AngularJS
Animation And Testing In AngularJSEdureka!
 
Building a dashboard using AngularJS
Building a dashboard using AngularJSBuilding a dashboard using AngularJS
Building a dashboard using AngularJSRajthilakMCA
 
jQuery for Sharepoint Dev
jQuery for Sharepoint DevjQuery for Sharepoint Dev
jQuery for Sharepoint DevZeddy Iskandar
 
Angular Mini-Challenges
Angular Mini-ChallengesAngular Mini-Challenges
Angular Mini-ChallengesJose Mendez
 
Building Reusable Custom Elements With Angular
Building Reusable Custom Elements With AngularBuilding Reusable Custom Elements With Angular
Building Reusable Custom Elements With AngularIlia Idakiev
 
Why You Shouldn't Write OO
Why You Shouldn't Write OO Why You Shouldn't Write OO
Why You Shouldn't Write OO Yehuda Katz
 
Organizing jQuery Projects Without OO
Organizing jQuery Projects Without OOOrganizing jQuery Projects Without OO
Organizing jQuery Projects Without OOYehuda Katz
 
Android Development with Flash Builder Burrito
Android Development with Flash Builder BurritoAndroid Development with Flash Builder Burrito
Android Development with Flash Builder BurritoJeff Bollinger
 
Knockoutjs databinding
Knockoutjs databindingKnockoutjs databinding
Knockoutjs databindingBoulos Dib
 

Similar to Salesforce Lightning Tips & Tricks (20)

Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinWill your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
Flex Building User Interface Components
Flex Building User Interface ComponentsFlex Building User Interface Components
Flex Building User Interface Components
 
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...
 
Devoxx 09 (Belgium)
Devoxx 09 (Belgium)Devoxx 09 (Belgium)
Devoxx 09 (Belgium)
 
Lightning salesforce
Lightning salesforceLightning salesforce
Lightning salesforce
 
JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
 
Animation And Testing In AngularJS
Animation And Testing In AngularJSAnimation And Testing In AngularJS
Animation And Testing In AngularJS
 
Building a dashboard using AngularJS
Building a dashboard using AngularJSBuilding a dashboard using AngularJS
Building a dashboard using AngularJS
 
jQuery for Sharepoint Dev
jQuery for Sharepoint DevjQuery for Sharepoint Dev
jQuery for Sharepoint Dev
 
Angular Mini-Challenges
Angular Mini-ChallengesAngular Mini-Challenges
Angular Mini-Challenges
 
Building Reusable Custom Elements With Angular
Building Reusable Custom Elements With AngularBuilding Reusable Custom Elements With Angular
Building Reusable Custom Elements With Angular
 
Why You Shouldn't Write OO
Why You Shouldn't Write OO Why You Shouldn't Write OO
Why You Shouldn't Write OO
 
Organizing jQuery Projects Without OO
Organizing jQuery Projects Without OOOrganizing jQuery Projects Without OO
Organizing jQuery Projects Without OO
 
Android Development with Flash Builder Burrito
Android Development with Flash Builder BurritoAndroid Development with Flash Builder Burrito
Android Development with Flash Builder Burrito
 
Knockoutjs databinding
Knockoutjs databindingKnockoutjs databinding
Knockoutjs databinding
 

More from Thinqloud

Salesforce summer 18 release notes highlights by thinqloud
Salesforce summer 18 release notes highlights by thinqloudSalesforce summer 18 release notes highlights by thinqloud
Salesforce summer 18 release notes highlights by thinqloudThinqloud
 
Salesforce news sumary may 2018 - thinqloud
Salesforce news sumary   may 2018 - thinqloudSalesforce news sumary   may 2018 - thinqloud
Salesforce news sumary may 2018 - thinqloudThinqloud
 
Salesforce spring 18 release highlights by thinqloud
Salesforce spring 18 release highlights by thinqloudSalesforce spring 18 release highlights by thinqloud
Salesforce spring 18 release highlights by thinqloudThinqloud
 
Salesforce Recap 2017 by Thinqloud
Salesforce Recap 2017 by ThinqloudSalesforce Recap 2017 by Thinqloud
Salesforce Recap 2017 by ThinqloudThinqloud
 
Women In Tech (WIT) Jaipur - Jina Chetia - Thinqloud
Women In Tech (WIT) Jaipur - Jina Chetia - ThinqloudWomen In Tech (WIT) Jaipur - Jina Chetia - Thinqloud
Women In Tech (WIT) Jaipur - Jina Chetia - ThinqloudThinqloud
 
Winter 18 Release Notes Highlights - Zen4orce
Winter 18 Release Notes Highlights - Zen4orceWinter 18 Release Notes Highlights - Zen4orce
Winter 18 Release Notes Highlights - Zen4orceThinqloud
 
Introduction To Einstein Vision - Zen4orce
Introduction To Einstein Vision - Zen4orceIntroduction To Einstein Vision - Zen4orce
Introduction To Einstein Vision - Zen4orceThinqloud
 
What Is Salesforce CRM, Editions, Licenses?
What Is Salesforce CRM, Editions, Licenses?What Is Salesforce CRM, Editions, Licenses?
What Is Salesforce CRM, Editions, Licenses?Thinqloud
 
Salesforce Einstein - Everything You Need To Know
Salesforce Einstein - Everything You Need To KnowSalesforce Einstein - Everything You Need To Know
Salesforce Einstein - Everything You Need To KnowThinqloud
 
Salesforce Summer '17 Release Highlights | Zen4orce
Salesforce Summer '17 Release Highlights | Zen4orceSalesforce Summer '17 Release Highlights | Zen4orce
Salesforce Summer '17 Release Highlights | Zen4orceThinqloud
 
2016 Salesforce Release Highlights
2016 Salesforce Release Highlights2016 Salesforce Release Highlights
2016 Salesforce Release HighlightsThinqloud
 
Get started with data migration
Get started with data migrationGet started with data migration
Get started with data migrationThinqloud
 
Handling of Large Data by Salesforce
Handling of Large Data by SalesforceHandling of Large Data by Salesforce
Handling of Large Data by SalesforceThinqloud
 
Our top picks from Salesforce Winter'17 release !!
Our top picks from Salesforce Winter'17 release !!Our top picks from Salesforce Winter'17 release !!
Our top picks from Salesforce Winter'17 release !!Thinqloud
 
Digital Marketing Automation with Salesforce Marketing Cloud
Digital Marketing Automation with Salesforce Marketing CloudDigital Marketing Automation with Salesforce Marketing Cloud
Digital Marketing Automation with Salesforce Marketing CloudThinqloud
 
Salesforce Lightning Process builder
Salesforce Lightning Process builderSalesforce Lightning Process builder
Salesforce Lightning Process builderThinqloud
 
Fundraising applications For NonProfits
Fundraising applications For NonProfitsFundraising applications For NonProfits
Fundraising applications For NonProfitsThinqloud
 
Security Testing using ZAP in SFDC
Security Testing using ZAP in SFDCSecurity Testing using ZAP in SFDC
Security Testing using ZAP in SFDCThinqloud
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Thinqloud
 
Discover the Connection - NonProfits and CRM
Discover the Connection - NonProfits and CRMDiscover the Connection - NonProfits and CRM
Discover the Connection - NonProfits and CRMThinqloud
 

More from Thinqloud (20)

Salesforce summer 18 release notes highlights by thinqloud
Salesforce summer 18 release notes highlights by thinqloudSalesforce summer 18 release notes highlights by thinqloud
Salesforce summer 18 release notes highlights by thinqloud
 
Salesforce news sumary may 2018 - thinqloud
Salesforce news sumary   may 2018 - thinqloudSalesforce news sumary   may 2018 - thinqloud
Salesforce news sumary may 2018 - thinqloud
 
Salesforce spring 18 release highlights by thinqloud
Salesforce spring 18 release highlights by thinqloudSalesforce spring 18 release highlights by thinqloud
Salesforce spring 18 release highlights by thinqloud
 
Salesforce Recap 2017 by Thinqloud
Salesforce Recap 2017 by ThinqloudSalesforce Recap 2017 by Thinqloud
Salesforce Recap 2017 by Thinqloud
 
Women In Tech (WIT) Jaipur - Jina Chetia - Thinqloud
Women In Tech (WIT) Jaipur - Jina Chetia - ThinqloudWomen In Tech (WIT) Jaipur - Jina Chetia - Thinqloud
Women In Tech (WIT) Jaipur - Jina Chetia - Thinqloud
 
Winter 18 Release Notes Highlights - Zen4orce
Winter 18 Release Notes Highlights - Zen4orceWinter 18 Release Notes Highlights - Zen4orce
Winter 18 Release Notes Highlights - Zen4orce
 
Introduction To Einstein Vision - Zen4orce
Introduction To Einstein Vision - Zen4orceIntroduction To Einstein Vision - Zen4orce
Introduction To Einstein Vision - Zen4orce
 
What Is Salesforce CRM, Editions, Licenses?
What Is Salesforce CRM, Editions, Licenses?What Is Salesforce CRM, Editions, Licenses?
What Is Salesforce CRM, Editions, Licenses?
 
Salesforce Einstein - Everything You Need To Know
Salesforce Einstein - Everything You Need To KnowSalesforce Einstein - Everything You Need To Know
Salesforce Einstein - Everything You Need To Know
 
Salesforce Summer '17 Release Highlights | Zen4orce
Salesforce Summer '17 Release Highlights | Zen4orceSalesforce Summer '17 Release Highlights | Zen4orce
Salesforce Summer '17 Release Highlights | Zen4orce
 
2016 Salesforce Release Highlights
2016 Salesforce Release Highlights2016 Salesforce Release Highlights
2016 Salesforce Release Highlights
 
Get started with data migration
Get started with data migrationGet started with data migration
Get started with data migration
 
Handling of Large Data by Salesforce
Handling of Large Data by SalesforceHandling of Large Data by Salesforce
Handling of Large Data by Salesforce
 
Our top picks from Salesforce Winter'17 release !!
Our top picks from Salesforce Winter'17 release !!Our top picks from Salesforce Winter'17 release !!
Our top picks from Salesforce Winter'17 release !!
 
Digital Marketing Automation with Salesforce Marketing Cloud
Digital Marketing Automation with Salesforce Marketing CloudDigital Marketing Automation with Salesforce Marketing Cloud
Digital Marketing Automation with Salesforce Marketing Cloud
 
Salesforce Lightning Process builder
Salesforce Lightning Process builderSalesforce Lightning Process builder
Salesforce Lightning Process builder
 
Fundraising applications For NonProfits
Fundraising applications For NonProfitsFundraising applications For NonProfits
Fundraising applications For NonProfits
 
Security Testing using ZAP in SFDC
Security Testing using ZAP in SFDCSecurity Testing using ZAP in SFDC
Security Testing using ZAP in SFDC
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...
 
Discover the Connection - NonProfits and CRM
Discover the Connection - NonProfits and CRMDiscover the Connection - NonProfits and CRM
Discover the Connection - NonProfits and CRM
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 

Salesforce Lightning Tips & Tricks

  • 2. Did you know that Aura Id does not allow dynamic values? aura:id cannot be allocated dynamically because aura:id doesn't support expressions. For ex: The below is not allowed One can only assign literal string values to aura:id. $<ui:inputText aura:id="{!v.index + '_sample'}"/> Setting a value to an element using aura:id For ex: .cmp <ui:inputText aura:id="sampleAura"/> .js component.find("sampleAura").set("v.value","Some Value“) Lightning utility function to check whether an attribute is defined or not. OOB utility method to check whether the attribute is undefined or not $A.util.isUndefined(component.get("v.someData“)
  • 3. Cache Elements in jQuery to load the Lightning Page faster For better performance one should reduce the DOM touches as much as possible. So it's a good idea to cache the jQuery objects. To cache an element just assign it into a variable for later use. <script type="text/javascript"> var $element = $('#selector'); if ($element.is(':hidden')) { $element.addClass('active').show(); $element.data("custom", "abc123"); } //some other code $element.hide(); </script> Loading dependent JS files in sequence. Facing JS dependencies error in lightning might be because of required prerequisite file is not loaded first for ex: jQuery Instead of loading files individually. For ex – The dependent files should be loaded in the desired sequence. For ex – <ltng:require scripts="/resource/jquery" /> <ltng:require scripts="/resource/datatable.js"/> <ltng:require scripts="/resource/jquery,/resource/datatable.js" /> Understanding the 'c' and 'v' conventions in lightning component. c stands for controller which includes both Client side js controller and server-side Apex controller Referenced as "{!c.doSomething}"in an expression in the mark-up or as component.get("c.getSomething") from JavaScript. v is the view, the most common use of "v" is to access the attributes on the component, as in expressions with "{!v.someAttribute}" or in JavaScript with component.get("v.someAttribute").
  • 4. Calling JS function once pre-requisites JS are loaded. Initiating a call once the JS required files are loaded: .cmp <ltng:require scripts="/resource/jquery" afterScriptsLoaded="{!c.setup}" /> .js ({ setup : function(component, event, helper) { //do something here } }) Calling JS method on component load in lightning. .cmp <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> .js doInit: function(component, event, helper) { //do something } Fix the issue of overridden css when ui:button is used together with SLDS Calling JS function on button click, but don't want to use ui:button because of conflicting design compared to SLDS. JS function can be called using press attribute on button. For ex – Similarly it can be achieved on button tag using onclick attribute- <ui:button aura:id="button" label="Click me" press="{!c.callFunction}"/> <button class="slds-button" onclick="{!c.callFunction}">Click Me</button>
  • 5. Unable to find your custom component in Lightning App Builder? To be accessible in the Lightning App Builder or a Lightning Page, a component must implement the flexipage:availableForAllPageTypes interface <aura:component implements="flexipage:availableForAllPageTypes"> </aura:component> Getting the record ID in custom lightning record pages. In order to access the recordI ID, force:hasRecordId has to be implemented in lightning component Note - An attribute named as recordId will be generated automatically when hasRecordId is implemented. .cmp <aura:component implements="force:hasRecordId"> </aura:component> Record Id can be accessed directly in cmp using expression {!v.recordId} In JS it can be accessed by component.get("v.recordId") Would you like to bind events with your lightning icons? Use lightning:buttonIcon - an icon-only HTML button A lightning:buttonIcon component represents an icon-only button element that executes an action in a controller. JS events can be bound to the co mponent. For Clicking the button triggers the client-side controller method set for onclick. https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_lightning_buttonIcon.htm If you would like to use Sprited icon, svgIcon component has to be replicated as Sprited non-inline SVGs are not supported in Lightning yet https://www.lightningdesignsystem.com/resources/lightning-svg-icon-component-helper/
  • 6. Selecting an element with .(dot) in its ID in Lightning. The backslash should be used in the selector to select the element having period in its ID. The way to use CSS in Lightning components. Components should take up 100% of whatever container they display in. Adding a left or right margin changes the width of a component and can break the layout of the page. Some CSS rules remove the HTML element from the flow of the document. For example: if you want to set some size that go for grid system rather than defining it in CSS Minimizing DOM Manipulation in Visualforce/Lightning Common ways to improve jQuery performance are by compressing the scripts and limiting DOM manipulation as much as possible. Consider the following piece of code that appends a DOM Can be replace with a more efficient code to minimize DOM Manipulation inside a loop manipulation $("#some.ContentID").val(); float: left; float: right; position: absolute; position: fixed; for (var count=0; count<=rows.length; count++) { $('#tableObject').append('<tr><td>'+rows[count]+'</td></tr>'); } var str = ''; for (var count=0; count<=rows.length; count++) { str += '<tr><td>'+rows[count]+'</td></tr>'; } $('#tableObject').append(str);
  • 7. Zen4orce Service Offerings jQuery SALESFORCE CUSTOMIZATION SALESFORCE AUTOMATION ADVISORY SERVICES INTEGRATED SOLUTIONS Lightning Bootstrap Visualforce Appexchange Communities Service Cloud Sales Cloud GitHub Apex Web Services Visit www.zen4orce.com for further details about Zen4orce Services & Offerings. Skillset