Skip to main content
58 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://...
Eric's user avatar
  • 54.2k
52 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 ...
Renu Kumar's user avatar
41 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 ...
Tim's user avatar
  • 1,373
39 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 ...
Charles T's user avatar
  • 11k
39 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. ...
Tyler Dahle's user avatar
  • 2,719
37 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 ...
martin's user avatar
  • 12.7k
37 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"/>
manous's user avatar
  • 396
35 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 ...
Mohith Shrivastava's user avatar
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 ...
RedDevil's user avatar
  • 7,821
33 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 ...
Charles T's user avatar
  • 11k
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 ...
Greg Rewis's user avatar
32 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 ...
Christian Menzinger's user avatar
31 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: { ...
Folkert's user avatar
  • 2,712
30 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 ...
Praveen's user avatar
  • 10.1k
29 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://<...
Ranga's user avatar
  • 1,722
29 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 ...
Daniel Collier's user avatar
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}" ...
Caspar Harmer's user avatar
29 votes
Accepted

Simple example on how to use Promises to call @AuraEnabled Apex methods?

Using Promises, at least we can make it look like that in the controller: onclick : function(cmp, evt, hlp) { hlp.apex(cmp,'myServerSideAction_1',{ input : 'START-PROMISE' }) .then(...
Uwe Heim's user avatar
  • 28.4k
29 votes
Accepted

Avoid Proxy objects in debug statements for a Lightning component

This will get it out of proxy and back into nice, readable format. console.log(JSON.parse(JSON.stringify(myObject))); Used it so much I made a snippet of it (vscode, sublime, maybe others) "xlog": {...
Shane McLaughlin's user avatar
28 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 ...
Joe B's user avatar
  • 1,182
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>
Naval Sharma's user avatar
  • 1,687
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 ...
Praveen's user avatar
  • 10.1k
27 votes
Accepted

How efficient is Lightning Data Service when working with multiple records?

After doing some testing, I can say that this is very inefficient. Loading more than about 6 records caused a separate loading to occur. While the system did not crash, as I hypothesized originally in ...
sfdcfox's user avatar
  • 495k
26 votes
Accepted

How to Disable ui.button in Lightning Component

The right syntax to do this is below var btn = event.getSource(); btn.set("v.disabled",true);//Disable the button
Mohith Shrivastava's user avatar
26 votes
Accepted

Component events vs Application events (component.getEvent vs $A.get)

Component events: to talk to a parent using the capture and bubbling mechanism, like with DOM events. Usually, one component is interested by the event, like an event aggregator. Application events: ...
JF Paradis's user avatar
  • 2,460
26 votes
Accepted

SLDS - How to position a spinner on a Lightning component

You need to apply position: relative to the component element, in your case uploadCard. This contains the overlay to within the boundaries of your component The following code works as expected (...
Alex Brausewetter's user avatar
26 votes
Accepted

How to check List size in aura:iteration

There's a handful of ways, but the most robust would probably be to see if it's not(empty(...)): <aura:if isTrue="{!not(empty(v.opportunityList))}"> ... This will suppress rendering if the ...
sfdcfox's user avatar
  • 495k
25 votes
Accepted

Refresh lightning component Opportunity page on Stage progress bar

When you update the opportunity stage using the Sales Path Component, it shows a toast after the update. You can handle that showToast event and then update your component accordingly. <aura:...
Santanu Halder's user avatar
25 votes
Accepted

Add button to the footer of a Lightning Quick Action component

I'm afraid you can't. I would like to be able to do it to, at least customize the behavior of the "Save" button, but unfortunately it's not possible. As you said, you need either to put the button ...
Fabien Taillon's user avatar
24 votes
Accepted

Show custom error on lightning:input

This is a bit of an old question now, but I've discovered another way which seems pretty legit. The validity attribute of lightning:input is not just for reading the validity, you can also set it. So, ...
Aidan's user avatar
  • 13.7k

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