Questions tagged [lightning]

This tag is for questions related to the "Lightning Experience" which comprises a number of elements around a new User Interface on the Salesforce Platform. While it can still be used in a server side MVC environment, it is primarily a MV UI where the Controller is JavaScript based operating from the user's browser. Lightning "Pages" are single page applications.

Filter by
Sorted by
Tagged with
8 votes
3 answers
42k views

How to trigger a click() event on LWC element

I'm trying to trigger a click event on file upload element in LWC but not able to do that. it doesn't throw any error or any file selection prompt. what I'm trying to achieve is clicking on a button ...
user2809299's user avatar
8 votes
3 answers
10k views

Return data from multiple objects in a single apex method in Lightning component framework

public class A { @AuraEnabled public static contact method(){ public account ac; public contact ct; ac=[select id,name from account Limit 1]; ct=[select id,name from contact LIMIT 1]; return ct; } In ...
SFDC Learner's user avatar
  • 2,344
8 votes
2 answers
5k views

Is it possible to set the value of an aura component to an expression dynamically?

For example, is it possible to bind the label of a button to a "myButtonLabel" attribute by adding an expression string like in the following example? $A.createComponent( "ui:button", ...
salesforce-hacker's user avatar
8 votes
1 answer
14k views

How to get Created Record ID in Lightning:recordEditForm?

I am using lightning:recordEditForm and lightning:inputField for creating a new record. this component is being used inside a lightning community builder. When i click the submit button, i am able to ...
Ravi Narayanan's user avatar
8 votes
2 answers
37k views

Custom List view buttons in the lightning environment

I have a requirement where I want to have a custom list view button with an ability to perform a mass custom action in the Lightning environment. I do not see an option to add lightning quick-action ...
Darshan Chhajed's user avatar
8 votes
2 answers
3k views

component.find(...).getElement not working after Summer 16 release

This line of code worked perfectly last week: var datepickerIcon = component.find('datepicker').getElement(); Now I'm getting this error: [TypeError: component.find(...).getElement is not a ...
Guille's user avatar
  • 83
8 votes
1 answer
8k views

lightning:input (text) - is it possible to have multiple patterns

I have a field that checks for 2 patterns. What I currently have is, in the text field's onchange handler, i check if the inputted string matches a certain pattern. However, I want to use lightning's ...
SamuelDev's user avatar
  • 790
8 votes
3 answers
14k views

How to make force:navigateToSObject to open record in new tab

Is there any way to make force:navigateToSObject event to open sObject in new tab?
Sarang's user avatar
  • 2,580
8 votes
1 answer
10k views

Dynamically create html components in lightning

Since HTML tags are first class citizens in lightning is there a way to instantiate them as components in lightning? Something like: $A.createComponent( "html:div", { "...
Scott Morrison's user avatar
8 votes
3 answers
13k views

Google Recaptcha V3 Implementation in Lightning Web Component

I have requirement to add Recaptcha in Lightning Web Component component. I have used V3 of google recaptacha. I have added https://www.google.com/recaptcha/api.js url in static resource and ...
Dhanik Lal Sahni's user avatar
8 votes
1 answer
2k views

Platform Event - lightning:empApi

I am using platform event and subscribing them in a lightning component. When i use my component as standalone lightning app or use it on lightning record page, the components subscribe well to the ...
Anshul Agrawal's user avatar
8 votes
3 answers
6k views

Favicon is not working outside of the Community

I am working on a Community for my portal with Napili template. I wanted to have my custom favicon to the entire community. I have configured Edit Head Markup in the community builder with this: &...
SatyaV's user avatar
  • 1,521
8 votes
1 answer
4k views

How to access child Web Component property from parent Aura Component controller?

I have an issue working on integration between Aura Component and Lightning Web Component. I have one nested Lightning Web Component in an Lightning Component. When I try to access the child I get ...
cloma's user avatar
  • 83
8 votes
4 answers
14k views

How to pass sobject list to apex from lightning?

SaveAccessRequest : function(component, event, helper) { var ARLIlist = component.get("v.AccessRequestLineItems"); var action = component.get("c.getSaveRecord"); var accessreq = component....
Venky's user avatar
  • 634
8 votes
6 answers
16k views

Lightning component quick action - send parameters to the lightning component

I have a lightning component that is available for use as lightning component quick action. I need to use this component from various object actions, for example, I will add a lightning component ...
Itai Shmida's user avatar
  • 5,025
8 votes
3 answers
2k views

Lightning App Builder vs Developer Console New Lightning App ( vs Community Builder )

I was under the assumption that the apps built in both the Lightning app builder and the Developer Console are the same except that one is visual drag & drop and the other one is via hands on ...
Vamsi Krishna Gosu's user avatar
8 votes
2 answers
1k views

Navigation in a Lightning App

I am creating my first lightning application and am using the LDS UI framework. I have created a header component with a navigation bar, and embedded this component in my Lightning app. <aura:...
col_powers's user avatar
8 votes
1 answer
2k views

Why DuplicateRecordItem is working only after INSERT and not after UPDATE of the dupe-record?

One key requirement of good Data Quality is a good duplicate prevention and merge process. Salesforce has introduced very powerful mechanisms like Duplicate and Matching-Rules for all SObjects. ...
Uwe Heim's user avatar
  • 28.4k
8 votes
2 answers
4k views

Lightning app builder, layout components side by side

I am trying to customize a layout for some lightning components, so that some are side by side, while others take up the entire pane in a custom tab it seems like dragging and dropping always takes ...
Jay Rizzi's user avatar
  • 465
8 votes
1 answer
24k views

Difference between visualforce and lightning in salesforce?

Visualforce and lightning both are frontend technologies can any one tell me what is the difference between visualforce and lightning ....when should we use lightning in salesforce
user avatar
8 votes
3 answers
2k views

How to Aura Handle multiple DmlExceptions

How should I handle multiple DmlException messages when using AuraHandledException inside an Apex Controller. If I do this: try { upsert value; } catch(DmlException e) { throw new ...
Robs's user avatar
  • 9,336
8 votes
1 answer
11k views

lightning:formattedDateTime changes the date

When I use the lightning:formattedDateTime in lightning component with a date field and formatting with "numeric", it displays a different value from the field. I use the following line of code: <...
Igor Santana's user avatar
8 votes
2 answers
12k views

Lightning toast is not working

I know by title it feels not acceptable but hear me out. I have registered below event in my cmp file <aura:registerEvent name="showToast" type="force:showToast" /> and an helper method as ...
Test's user avatar
  • 81
8 votes
1 answer
3k views

Does force:inputField support dependent picklists?

Let's say I have two picklists bound to force:inputField elements like so: <force:inputField value='{!v.obj.Database__c}' aura:id='database'/> <force:inputField value='{!v.obj....
Antonio Manente's user avatar
8 votes
2 answers
2k views

Lightning, what's the preferred way to bind output text? [Best Practise?]

So I'm going through a lot of the Lightning guides, and even through the reference documentation, and I'm coming across a bunch of inconsistencies, and it's either not explained why, or there are ...
Ben Naylor's user avatar
8 votes
4 answers
4k views

Google Tag Manager and Lightning Community and Components

I've managed to import the Google Tag Manager code into the using the lightning community settings tab. This loads perfectly fine and I can see the 'preview' window for google tag manager. <!-- ...
William Smith's user avatar
8 votes
3 answers
23k views

Lightning quick Action in the List view

I want to add a lightning quick action in the list view of opportunity. The quick action should use the Lightning component. How to add the quick action with lightning component in the List View?
user57911's user avatar
8 votes
2 answers
2k views

Confirming Unload/Navigation In Salesforce Lightning

Has anyone had any luck catching and optionally preventing navigation in the lightning experience? So for instance, if a user has unsaved data in a custom component and attempts to navigate by ...
wellmstein's user avatar
  • 1,821
8 votes
2 answers
1k views

Lightning Out without "My Domain"

I'm using Lightning Out in order to render my Lightning Components inside a Visualforce page. <apex:page showHeader="true" sidebar="true"> <apex:includeLightning /> <div id="...
smukov's user avatar
  • 5,553
8 votes
4 answers
5k views

Dynamic reference to static resource in lightning component

In lightning, we can reference to static resource by a value provider like: <img src="{!$Resource.staticResource}"/> Is there any smart way to make it dynamic like: <aura:attribute name="...
KamilK's user avatar
  • 121
8 votes
1 answer
1k views

Locker Service - Window object instead of SecureWindow

While Locker Service is activated, I have a script that is loaded by the Aura framework. If I put a debugger; to the start of that script, the this and window objects references the [object Window] ...
Marc-Antoine Veilleux's user avatar
8 votes
1 answer
525 views

Salesforce-lightning-cli lint & ES6 const reserved word

I am currently writing lightning components and to do so I use Ecmascript2015 standard (Object.assign, const, let, ...). Everything works perfectly but the https://www.npmjs.com/package/salesforce-...
Simonp's user avatar
  • 1,892
8 votes
1 answer
353 views

Global lightning components and their inheritance of public components

Wondering if someone can clear this up for me; I have a global component in a managed package. I want to reuse this global component outside of the managed package. In a component outside of the ...
Autonomy's user avatar
  • 183
8 votes
1 answer
1k views

Canvas URL and postMessage

I'm trying to determine if this is an unsupported Canvas scenario or if there's something misconfigured in the org or the browser that would otherwise allow it to succeed. For the purpose of ...
Mark Pond's user avatar
  • 23k
8 votes
1 answer
294 views

Lightning performance finding

This is not a question, but one of my findings after spending some significant time on Lightning framework. Problem : I was querying ~3k accounts and related child objects and was building a wrapper ...
Salesforcesmarty's user avatar
8 votes
1 answer
460 views

Will Base Lightning Components ever replace complex <apex:> components?

Salesforce just announced Base Lightning Components and Visualforce developer are more than happy to see it. Having to write huge piles of complex html divs for Lightning really feels like a step ...
Robert Sösemann's user avatar
8 votes
1 answer
2k views

How to detect minimize action on a utility bar item?

PROBLEM STATEMENT I have a 'Compose Email' component which is embedded in the docked utility bar. Please see below image for clarity. I am using lightning:fileUpload to allow multiple email ...
Lightning Evangelist's user avatar
8 votes
3 answers
643 views

How to get rid of empty blue row in LE dashboard table component?

In all six table components in my LE dashboard (Summer'18 preview sandbox), I see as the last item an empty blue row. Is there a way to get rid of this? I tried limiting the number of groups, but that ...
Sander de Jong's user avatar
8 votes
0 answers
343 views

New Lightning Warning

Last night when I left, I was not receiving this warning. This morning, I get this warning multiple times. Even if I navigate to something that I have not customized at all (ie the dashboard home ...
Frank's user avatar
  • 421
7 votes
2 answers
18k views

(LWC) - Lightning Datatable: Custom Data Types

Is it possible to create lookup fields and picklists with custom data types now? Documentation says: Create your own data types if you want to implement a custom cell, such as a delete row button ...
Atlas Can's user avatar
  • 1,877
7 votes
1 answer
7k views

Lightning application vs Lightning component

I don't have much experience using lightning, but for what I've seen using a lightning component as a top level of the application seems to be much more useful than using an actual standalone ...
Parkaboy0's user avatar
7 votes
2 answers
7k views

Word Break - Lightning

I want the string to be transfered to the next line in lightning. In salesforce classic I would just apply to the element style="word-break: break-all". In lightning there's a special tag for that. ...
EvAzi's user avatar
  • 1,041
7 votes
1 answer
17k views

Refresh parent page on close of lightning quick action modal

I have a custom lightning component which pops up when I click on a quick action in a record detail page. Once I click on a button in the popup, I want the popup to close and the parent detail page ...
Rimii's user avatar
  • 75
7 votes
2 answers
23k views

How to read Lightning Checkbox toggle button value or checked status?

We're using the toggle checkbox button as below. <aura:attribute name="viewAllItemsSwitch" type="String" description="View all on/off" default="off"/> <div class="slds-...
Pasan Eeriyagama's user avatar
7 votes
2 answers
17k views

How to query a file uploaded as an attachment in lightning experience?

According to the release notes Lightning Experience Limitations, attachments uploaded in lightning aren't the same as attachments uploaded through salesforce classic. How can i query for the ...
Gusk's user avatar
  • 260
7 votes
3 answers
2k views

Get current namespace in Lightning

If we have a lightning component, which is a part of managed package, is possible somehow purely from js code to figure out current namespace, i.e. without sending additional request to the server? I ...
wesaw's user avatar
  • 3,020
7 votes
2 answers
8k views

Accessing Attribute in Controller Lightning Salesforce

I am trying to access the attribute which I am assigning the value in Helper, and calling the helper in Controller init, but while accessing the the same attribute in init, its returning undefined. ...
Abhi Tripathi's user avatar
7 votes
1 answer
3k views

Cannot update a field to a Lookup, MasterDetail, or Hierarchy from something else (44:13)

For Push and Deploy Lightning Web Component Files module of Lightning Web Components basics, when I try to deploy from the scratch org to Dev org, it gives me the following error : Cannot update a ...
Ashutosh Arora's user avatar
7 votes
2 answers
8k views

What's the correct format to set a default value to a DateTime aura:attribute?

I would like to set a default value to a DateTime aura:attribute, but could not find the correct format. I tried the following but it didn't work: <aura:attribute name="myDateTime" type="DateTime"...
Fabien Taillon's user avatar
7 votes
1 answer
12k views

Popover in Lightning Web Component (LWC)

I am trying to implement a popover in Salesforce LWC. I am able to get it work but only issue is the popover is not actually coming above the body like a modal. You can see the sample here. As you see ...
malu's user avatar
  • 151