57 votes

What is the difference between Aura and Lightning frameworks?

First off: "Lightning" is a larger (marketing) effort to rebrand existing and new Salesforce1 platform services under one shiny new umbrella. "Salesforce1 Lightning" consists of the following pieces, ...
user avatar
  • 9,373
56 votes
Accepted

What is suggested approach to transfer VF pages to be lightning ready

WINTER-18 Update new property for VF <apex:page> tag lightningStyleSheets="[false|true]" will supposedly be the single thing you need to do to convert VF pages to SLDS type styles https://...
user avatar
  • 53.2k
52 votes
Accepted

How to call a Salesforce REST URL from Lightning Component?

Marty is correct, although I would like to temper the description of this being "unfortunate" a bit with some background on why the security policy is in place. In order for us to satisfy our internal ...
user avatar
  • 9,984
50 votes
Accepted

@AuraEnabled Support for Apex Class Return Types?

One thing to check is that the accessors on any objects included in the response include the @AuraEnabled annotation. For example, the following tripped me up recently when adapting sample code for a ...
user avatar
  • 2,560
50 votes
Accepted

Infinite Loop Caused by Controller Action in Lightning Component

I found the solution. DO NOT GIVE YOUR JAVASCRIPT METHOD AND YOUR APEX CONTROLLER METHOD THE SAME NAME. When I defined the saveAction: var saveAction = component.get("c.saveAccount"); the ...
user avatar
50 votes

Call another method from a method in same Lightning controller

try this, it works perfectly ({ bar : function(component, event, helper) { console.log('bar just happened'); }, foo : function(component, event, helper) { // I would love ...
user avatar
49 votes
Accepted

What are the available $A JavaScript functions in Lightning?

Answering my own question. The Lightning Components Developer's Guide has the following: The Aura object is the top-level object in the JavaScript framework code. For all the methods available ...
user avatar
  • 28.7k
48 votes
Accepted

How to use fieldsets with Lightning?

As Doug states, I started looking into this, and ended up with a bigger test/demo/etc. than I originally planned. I took the "wrapper" class approach, starting with an AuraEnabled version of ...
user avatar
  • 2,560
38 votes

Call another method from a method in same Lightning controller

The shortest way of calling a controller function from another controller function you can use: $A.enqueueAction(component.get('c.controllerMethod')); When you are calling a helper function from a ...
user avatar
  • 1,254
36 votes
Accepted

Use of setCallBack() in Lightning

Basically, the setCallback() function sets a function to run after the action finishes. You might be wondering why we can't just call getReturnValue() on the action right after enqueuing it and why ...
user avatar
  • 12.3k
36 votes
Accepted

Lightning navigation does not refresh the state of components, how to fix a bug

We're running into this too. We expected it to be the case that if we navigate to a Lightning Component URL once, then walk through other pages, then navigate back to it with a different URL, we'll ...
user avatar
  • 10.7k
36 votes
Accepted

Styling lightning:combobox drop down to not hide inside modal and extend modal length?

Ugh, I finally found the culprit. The drop down was absolute positioned, but applying a higher z-index was not doing anything. It turns out it was the overflow options of the slds-modal__container. ...
user avatar
  • 2,369
35 votes
Accepted

Help me to undestand this lightning helper methods (reduce & showHelpMessageIfInvalid)?

1 reduce - what this function will do The reduce() method applies a function against an accumulator and each element in the array (from left to right) to reduce it to a single value. Read here for ...
user avatar
  • 7,585
34 votes
Accepted

Is it possible to remove the label on lightning:namespace components?

Yes you can set the variant attribute to "label-hidden", so your code should look like: <lightning:input type="number" label="number" variant = "label-hidden" name="aNumberInputField"/>
user avatar
  • 366
33 votes
Accepted

Error when trying to remove a lightning component's <design:attribute>

This is a bit tricky Exercise .In fact the error gives an idea on why this showing up .When you have implemented a lightning Interface of AllPageTypes which means you cannot get rid of design file ...
user avatar
32 votes
Accepted

(Why) Should I Use Lightning Apps?

Lightning Components will give much greater reusability of features, separation of concern between components, and are much more opinionated about structure. These are fairly neutral things. Several ...
user avatar
  • 19.1k
32 votes
Accepted

Lightning App - getting URL parameter

In lightning whatever attribute you define can be passed as a query parameter . Lets take a look with sample example <aura:application> <aura:attribute name="whom" type="String" default="...
user avatar
32 votes
Accepted

Lightning Experience: How to prevent the display of obsolete data?

Actually, this problem is due to the "aggressive" caching setting in LEX. Go to Setup Home > Security > Session Settings. Uncheck the option: Enable secure and persistent browser caching to improve ...
user avatar
31 votes
Accepted

Lightning: Bug in Lightning framework when using aura:renderIf?

This is a known issue in the Framework. We do plan to fix it, but there is a workaround and so it's not #1 on our plate over things like Performance. Short Story <aura:renderIf isTrue="{!v....
user avatar
  • 3,106
31 votes
Accepted

How to pass query parameters in URL in Salesforce Summer 19 Release?

I think there is a Critical Update that gets auto-enabled for Summer '19, that forces Lightning URL parameters to be namespaced. And the default namespace for orgs is "c". So if you add ?foo=bar to ...
user avatar
  • 10.7k
29 votes
Accepted

lightning components: can helpers call other helpers

You can definitely call another function within the same object using the this keyword. I just tested the following code and it works. The example doesn't make sense but it demonstrates the ...
user avatar
29 votes
Accepted

Salesforce Lightning Component Cache

By looking at this article on Lightning Components Performance Best Practices, it looks like the only way to solve the cache problem is to disable the cache during development and keep it on in ...
user avatar
  • 10.1k
29 votes
Accepted

What is the correct way to pass Parameters to Lightning JS controller from UI:Button?

There is no need for a form in your td. Wrap your button in a div, attach the value to the div via a data- attribute and grab it from the event.currentTarget. Eg: <div onclick="{!c.removeItem}" ...
user avatar
29 votes
Accepted

Spring 18 <lightning:datatable> how to add a button column

To display the button on the rows, you need to put the attributes in the typeAttributes object just like with actions in the row above in your example. { type: 'button', typeAttributes: { ...
user avatar
  • 2,592
28 votes
Accepted

Unable to set lightning:select value when using dynamically created options

You should make the option element selected explicitly. Can you not try as below. <option value="{!st}" selected="{!st==v.state}">{!st}</option>
user avatar
  • 1,627
28 votes

Getting the URL parameter into Lightning component using the "{! paramName}" expression

After Summer 18 release (API version 43 and up) we can do this. Implement lightning:isUrlAddressable interface and use pageReference attribute. Example. - Component Assume url is https://<...
user avatar
  • 1,672
27 votes
Accepted

When to use {#v.attrib} vs {!v.attrib}?

If you want to show a value dynamically based on a aura:attribute, generally we tend to use: {!v.attrib} Eg: <ui:button label="{!v.attrib}" /> So if you do cmp.set('v.attrib','test'), then ...
user avatar
  • 10.1k
27 votes
Accepted

How to navigate in lightning out?

I ran into the same issue. I have Lightning Components I want to use in VF pages AND in Lightning apps running in the Lightning Experience. I also didn't want to update the components to check to see ...
user avatar
  • 1,162
27 votes

Set width of modal window of lightning action

There seems to be some confusion around this question. The question asks specifically how to increase modal width when the modal is opened by a lightning action button. Some answers will work when ...
user avatar
27 votes
Accepted

How do I debug my lightning component?

General Tools and settings: use Chrome + built in Dev Tools + Lightning Component Inspector be sure debug mode is enabled in your org (Setup: Lightning Components) be sure caching is disabled in your ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible