46 votes
Accepted

LWC as QuickAction in Salesforce

[EDIT] Starting the Summer '21 release, you be able to use lightning web components directly as a Quick Action as described here. You'll just need to set the myComponent.js-meta.xml metadata file ...
user avatar
35 votes
Accepted

Getting Session ID in Lightning

So, as it turns outs there is no way of getting a valid API-capable Session Id from lightning component, here is a quote from the partner discussion forums: Three things: There's no $Api global ...
user avatar
  • 2,032
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

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

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

How to use custom LWC lightning component in lightning-datatable

Step 1 : create custom component as follows. pocCustomComp.html : <template> <div> Id: {recordId} </div> <lightning-file-upload label="Upload" ...
user avatar
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
25 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: ...
user avatar
  • 2,440
20 votes
Accepted

Can we use the Lightning Design System in Visualforce pages but have the Lightning Experience disabled?

Salesforce Lightning Design system is implemented for Visualforce as a CSS library that you would include in your VF page as a static resource. In the same way you could include any other CSS library ...
user avatar
  • 19.1k
19 votes
Accepted

How do I create/expose properties that will be passed to my component from the Lightning App Builder

You have to create a design file (yourComponent.design). In the file you should put tags like so: <design:component> <design:attribute name="sObj" label="sObject" description="The Object ...
user avatar
19 votes

How to iterate over map in Salesforce Lightning Component?

You can't directly iterate over map. You need to do something like Apex Class: public class LightningController { @AuraEnabled public static Map < String, String > fetchMapData() { ...
user avatar
19 votes
Accepted

Need to preview a Lightning Component

Having a dummy app for the purpose of previewing is typically what I do. You don't need Lightning Out for this, though. Just put the component directly in the app: <aura:application extends="force:...
user avatar
  • 438k
18 votes
Accepted

How to display modal popup with a form inside a Lightning component

I had a similar challenge to build, but with a button. I managed to succesfully build a popup like you want, but I'm not 100% sure if it works in your code, but it's definitely worth a try. Component ...
user avatar
18 votes

Using spinner component in quick action lightning modal component not rendered as expected

Adding of "slds-is-relative" class to the parent div solved this issue for me: <div role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open"> <div class="slds-...
user avatar
18 votes

Actions on Case object in Lightning

There is a catch in case of cases and work orders objects when it comes to quick actions. In the article under Actions on record pages there is note that says Actions on cases and work orders ...
user avatar
  • 5,557
18 votes
Accepted

Display an image stored in ContentDocument (in lightning experience)

Looking at the Data Model of the Content Object as mentioned in this post, it looks like you need to get Id of the ContentVersion which is tied to you the ContentDocument record. Also to display ...
user avatar
  • 10.1k
17 votes
Accepted

Lightning application vs Lightning component

Lightning Apps are used to create standalone applications that can be used outside of the Lightning Experience. They're also required if you want to use Lightning Out (e.g. to use Lightning on another ...
user avatar
  • 438k
17 votes

connectedcallback vs renderedcallback in lightning web component

connectedcallback() The connected callback is executed when the component is inserted into DOM. Connected callback runs once when the component is inserted. If you know aura components then this is ...
user avatar
  • 10.8k
16 votes

lightning:spinner Overlay screen

I recently ran into this issue and the problem is that you need a slds-is-relative on the containing element. When a lightning component is used as part of a quick action SF automatically adds a ...
user avatar
  • 53.2k
14 votes
Accepted

Difference between lightning and ui tags

You can find the answer in the Winter 17 release notes here You can find base Lightning components in the lightning namespace to complement the existing ui namespace components. In instances where ...
user avatar
13 votes

Navigation in Desktop Lightning Experience not Destroying Components

Ok - So...The deal is that the Lightning Experience tries to speed up your backbutton by saving the last 5 entries in the stack for history purposes. That means, if you click your tab, click away, ...
user avatar
  • 1,761
13 votes
Accepted

Confused: Lightning Service Console only for Salesforce Classic?

I believe you've stumbled into a web of overloaded terminology and recent release changes. Here's a bit of history of the console naming and current state of affairs that I hope clears it up. Before ...
user avatar
  • 1,308
13 votes
Accepted

"aura:if" must not contain the '<' character

try the below. this will check if v.page is less than v.pages <aura:if isTrue="{!lessthan(v.page,v.pages)}"> documentation link : https://developer.salesforce.com/docs/atlas.en-us.lightning....
user avatar
  • 7,585
12 votes
Accepted

How to build custom UI that works both for users that have opted in to Lightning Experience and users that have not?

I just went through this exercise for a basic configuration page. Here is what I found out for a basic example: Liberal use of Javascript Remoting in place of submit elements (commandButton, ...
user avatar
  • 53.2k
12 votes
Accepted

Create record in Lightning with populated fields

URL hacks are not supported in Lightning Experience. The best way to prepopulate fields in Lightning Experience is to use actions. For example: on the Account object I created an action to create a ...
user avatar
  • 10.4k
12 votes

Create record in Lightning with populated fields

From the Summer '17 Release Notes - Prepopulate Fields on a Record Create Panel Speed up record creation with prepopulated field values. The sforce.one.createRecord function now includes ...
user avatar
12 votes
Accepted

<Design:Attribute> Documentation

At this point only attributes that are supported are String , boolean and int . So this is how the design file will look <design:component> <design:attribute name="SearchString" label="...
user avatar
12 votes
Accepted

How to generate/view PDF using Lightning Components?

There are two methods to show a PDF in Lightning Component. First, you can create a Visualforce page and embed it in the Lightning component. See detailed example here Second is, usage of PDF.JS ...
user avatar
  • 2,619
11 votes
Accepted

How to detect if a user is in Salesforce1 vs Lightning Desktop

With Spring 16 release, we are getting new values added to the existing $User.UITheme Global variable and to the UserInfo.getUiTheme() method which will help us to identify the current user's UI mode. ...
user avatar

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