Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [javascript-controller]

A controller is a JavaScript Object, created by a standard JavaScript object constructor. In the Aura Framework, the JavaScript controller is client-side.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

$A.get('$SObjectType.CurrentUser.Name') is undefined

I am using a script in the head markup file in the experience cloud. $A.get('$SObjectType.CurrentUser.Email') works fine, but $A.get('$SObjectType.CurrentUser.Name') returns null. I tried debugging it,...
user131722's user avatar
2 votes
1 answer
52 views

User Name returning "null" at seemingly random instances

Okay this is a weird one. I have an aura component that I put on our user record pages that display that user's open opportunities. I pull the recordId from the URL, run SOQL to grab all open opps for ...
SethH's user avatar
  • 41
0 votes
0 answers
31 views

Subscribing to a Canvas App published event in an Aura Component controller

We have an Aura component that contains a Canvas App. The Canvas App uses the Canvas SDK to publish events. This is my Aura component's controller... ({ doInit: function (component, event, helper) { ...
nstuyvesant's user avatar
0 votes
1 answer
96 views

Notify Aura component of a window.location change

It looks like once an aura components (that overrides the New button of a custom object) is loaded and opened, it does not stop running when the user closes it and navigates to other pages. In fact, ...
dev4life's user avatar
  • 510
5 votes
2 answers
162 views

How to preserve string with newlines passing from LWC to VF controller for PDF rendering

I have a Lightning Web Component (LWC) which takes a text input from the user. The text input is entered via a lightning-textarea, i.e. can also contain text with newlines. The LWC contains an iframe ...
HeXor's user avatar
  • 287
0 votes
1 answer
478 views

LWC - lightning-record-edit-form 'onsuccess' Method Only Triggering Once

I have a LWC to replace the standard New button on the Opportunity object. This LWC presents the user with a lightning-record-edit-form so they can input the Opportunity details. They can then either ...
callum202's user avatar
0 votes
0 answers
25 views

Value set from JS controller does not reflect on CMP file

I am working on a functionality that hides a button and uses a wrapper for assigning a value (ex. wrapperClass.showButton = false). I checked the Apex debug and it is setting the wrapperClass....
Mareux's user avatar
  • 11
0 votes
1 answer
193 views

LWC issue with array variable being blank when accessed from another function

I am building a custom file upload component as follows. I prepare my list of uploaded files inside the function handleFilesUpload. I then call another function called handleSaveFiles but inside of ...
degmo's user avatar
  • 61
0 votes
1 answer
272 views

How do I calculate expression inside an LWC iterator?

I have an iterator rendering a list, simplified markup shown below: <template for:each={cells} for:item="cell"> <template lwc:if={showOption1}> ... </...
CloudHugger's user avatar
  • 1,757
-2 votes
2 answers
68 views

Sort Country picklist fetched using wire method [closed]

I have fetched country global picklist using wire method in Javascript. I need to put United states as the first value in the picklist. How should I sort the values written by wire method. @wire(...
saivinay manapuram's user avatar
1 vote
1 answer
133 views

Evaluating multiple record criteria in a loop

I am trying to loop over a returned list of records from a query and set several variable once I find the correct criteria. The struggle I'm having is that the criteria I'm want to find can exist over ...
user1718612's user avatar
2 votes
1 answer
2k views

LWC get field value from @wire result (single object) from apex query

I've searched for an answer but found none. The answer is probably simple, but I'm tired of trying and not finding a solution! I need to access the fields returned from the query. It does not return ...
Irene's user avatar
  • 1,839
0 votes
2 answers
478 views

A conditionally executed single line should be denoted by indentation

In a javascript file, I get the indentation code quality error: closeComp() { const selectEvent = new CustomEvent('hidemodal', { detail: true }); this.dispatchEvent(selectEvent); } ...
Anmol Khanna's user avatar
1 vote
1 answer
99 views

How to replace time part of DATETIME input by value from TIME input

I've tried to find an algorithm (Salesforce, aura) but without success. Probably, you have any ideas! I have: attribute <aura:attribute name="bulkApply" type="Map" default=...
Daniel Velesevich's user avatar
0 votes
1 answer
361 views

Javascript "getElementById" return null in Visualforce Page

Anyone help me, why Javascript "getElementById" return null in Visualforce Page. In my form, I have "Radio button" and "inputtextarea" My requirement is whenever click ...
Tara's user avatar
  • 1
1 vote
1 answer
732 views

Nested Array: Filter on a String [] /Map doesn't return results as expected

The below lightning component renders data as parent-child fashion. When user search for a particular carrier name/provider it has to display only that carrier/provider data underneath. Problem is i ...
user28452's user avatar
  • 441
0 votes
2 answers
3k views

How to display an account owner NAME instead of Owner.Id in LWC

Please, someone help me to display an Owner Name in LWC datatable instead of Owner Id. I have this apex controller and js code Controller public with sharing class AccountLwcTableController { @...
Vladislav Volynsky's user avatar
0 votes
1 answer
62 views

Salesforce Aura Component Tip

Is there a way to see Aura component and its js controller in production org? I don't have access to developer console.
Ishaan Jain's user avatar
0 votes
2 answers
2k views

lightning-input type=datetime [Unable to set / consider the locale time for the validation as per the Locale of the User]

.html snippet (LWC Component) .js snippet (LWC Component) import { LightningElement, track } from 'lwc'; export default class DateTimePickerLightningInput extends LightningElement { @track today; ...
Salesforce Developer's user avatar
0 votes
1 answer
44 views

Summery table lightning component

I am trying to built a summery or pivot table in lightning component. Currently I am getting repeated values inside my table, not the actual ones. Response inside .js is like this: { "Short ...
Kartik.S's user avatar
0 votes
1 answer
195 views

How to remove asterisk from the LWC form

I want to remove addition asterisk I think it because I disabled country. Any inputs please <lightning-input-address street-label="Street" city-label=&...
Mentee's user avatar
  • 111
1 vote
0 answers
124 views

Refresh all aura attributes(entire component) based on an action

I have a aura component that opens when we click on a button. Inside this component, when I do a certain action, the entire component needs to reload, basically I want all the aura:attributes to be ...
Dilipan Manoharan's user avatar
1 vote
0 answers
207 views

How to programmatically change the checked status of a lightning:input checkbox?

I have a toggle in my cmp and I'd like to be able to switch it back off in case of need. (I.e some error happens) in my cmp file: <div class="animals_container"> <aura:...
Frans's user avatar
  • 29
0 votes
1 answer
645 views

Unescaped Attribute Value XSS - how to sanitized event handlers in lightning aura component

How do we sanitize variables/controller calls [v.onRepeat/c.controllerCall] used in onclick/onchange events as per SonarQube standards. Here is the sample code : Issue 1 : <lightning:buttonIcon ...
Dusk123's user avatar
0 votes
1 answer
621 views

LWC: How to add integer value into an array in JS controller which is bound to the data property of lightning datatable

Let's consider the below scenario: I have a scenario to bind integer value which is calculated from apex function. I have to display integer value in lightning datatable column. Please find the code ...
Rose 's user avatar
  • 123
-1 votes
1 answer
228 views

What does FIELD_INTEGRITY_EXCEPTION mean?

when I try to save my aura controller this pop up doesn't allow me to save it Failed to save demo.js: Failed to parse CONTROLLER for js://c.demo: org.auraframework.util.json.JsonStreamReader$...
Sakshi's user avatar
  • 1
1 vote
2 answers
6k views

Generate and download PDF file from Base64 Encode String

I want to create a LWC to download a simple PDF file with a random string. Here is my code: Apex Class: public with sharing class PdfLwcController { @AuraEnabled public static String ...
Tran Tai's user avatar
1 vote
1 answer
208 views

Salesforce Aura lightning:checkboxGroup

I have an existing Aura component that I need to add some help text to. I have a lightning:checkboxGroup that I need to add some help text to one of the options. The code is below. What I need to do ...
Travis's user avatar
  • 352
4 votes
3 answers
2k views

Spread Operator Usage in LwC

I have a javascript related question. I have the piece of code using a spread operator var arrObj = [{ name : "m"}, { name : "mb"}]; var arrObj1 = [...arrObj]; console.log(arrObj1);...
Madhurima's user avatar
  • 1,395
2 votes
1 answer
842 views

How to close LWC Quick Action when the page is refreshed?

I have a quick Action button on Account page which is calling the LWC lightning-quick-action-panel component. By clicking on the quick Action button a model box opens, now when I refresh the Account ...
Subramani's user avatar
0 votes
1 answer
669 views

For loop with in another for loop in aura javascript causes performance issue how to overcome on this issue

Here is the code snippet where my filterList is original list contains 300 records data and newList contains the selected list values which an 165 as example as below for loop causes an performance ...
vijay's user avatar
  • 39
1 vote
1 answer
435 views

Converting native javascript code to aura component javascript

I have the following JS code and I'm trying to convert to aura component JS Controller, I'm getting error on the yield how would you make equivalent aura component code function* ...
ThreeOneThree's user avatar
0 votes
1 answer
218 views

Lightning Aura Component with external MailGo JS Library for mailto links

I'm an experienced back end java developer, but newer to Salesforce and front end development. I'm trying to implement this MailGo JS Library to handle our :mailto links a little prettier than just ...
TylerTwoForks's user avatar
0 votes
1 answer
239 views

how to reduce lines of code in LWC

in my LWC project have a function per button, and I want to reduce lines and functions using a switch for the buttons. all function buttons are equal and i try use a switch, but I don't know how to ...
DDCruz's user avatar
  • 21
1 vote
2 answers
94 views

Reusing call back functions in Lightning

I have two Apex methods "c.getStudentGrades" and "c.getStudentAverage". They both reference the same table and use the same ID but the returned results are different. I'm trying to ...
learnerforlife's user avatar
2 votes
1 answer
277 views

Reduce the number of chainings in AURA

I am new to Aura, and I am stuck on how to proceed with the task given. Actually, in the Init method, there are many chaining that should be optimized. My controller class doInit: function (component, ...
Rahul Allada's user avatar
0 votes
1 answer
2k views

How to get unique values from result list in LWC

I have one list method like below @AuraEnabled public static List<String> getDetails(String AccName){ listacNameList = new list(); List accList = new List([Select Id, Name from account ...
Sandy's user avatar
  • 7
2 votes
1 answer
139 views

How to remove sf form warning

I have this lightning component recordEditForm - <lightning:recordEditForm aura:id="crearAgenteForm" recordId="{!v.recordId}" onsubmit="{!c.handleSubmit}&...
zodiak's user avatar
  • 23
2 votes
1 answer
176 views

Enable to iterate an array

Hope you guys are safe and doing well. I'm new to Salesforce Development and trying to iterate an array but enable to do it. I want to display 7 input fields. While opening the org I'm getting the ...
Prince Sharma's user avatar
0 votes
1 answer
2k views

Getting error [Cannot read properties of null (reading 'selectCheckbox')] onclicking the LWC component

I'm getting the below error Error screenshot : I'm trying to retrieve checkbox options from a child component through the parent JS but I'm getting this error. I'm new to JS and lightning so can you ...
Kiran.pandiyan's user avatar
0 votes
2 answers
213 views

Aura Redirect Component Only if CustomerID is not Null

I wrote code for an Aura Redirect Component but I'm having trouble getting it to redirect only if the CustomerId is not null. Here's my code. Apex Controller public with sharing class NetsuiteQuote { ...
Laura Bejjani's user avatar
0 votes
1 answer
326 views

How can I get "pattern"attribute from component (html) to Controller (javascript)?

How can I get "/ˆ[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,6}$/" in the Controller class? <label for="clientEmail">E-mail</label> ...
Cline's user avatar
  • 143
0 votes
1 answer
100 views

Populating date on e.force:createRecord

I'm trying to populate the last day of the year on the CloseDate (Date) field. I've tried everything from this link: https://stackoverflow.com/questions/13255114/retrieve-the-last-day-of-the-year-in-...
ThatGuy's user avatar
  • 85
0 votes
1 answer
5k views

How to get the uploaded file's size when using lightning-file-upload?

I've tried the following but it returns 'undefined. event.detail.files[0].size
Bahman.A's user avatar
  • 858
0 votes
1 answer
5k views

window.addEventListener is fired multiple times

Receiving data via addEventLister to my aura component and do some actions based on it, refer to the code below: window.addEventListener("message", $A.getCallback(function (event) { try{ ...
Mehedi's user avatar
  • 409
0 votes
1 answer
1k views

Fetching User Info in Lightning Component

I'm trying to create a Lightning Component to integrate Sendbird into Salesforce by following this guide: https://sendbird.com/developer/tutorials/how-to-integrate-sendbird-with-salesforce I've ...
Todd Sprinkel's user avatar
0 votes
1 answer
952 views

How to capture the changes happened to the LWC component

I have an LWC component in which I'm displaying list of records in table format. I've implemented auto save functionality as well. When the current user is working in the component and at the same ...
sfMon's user avatar
  • 49
0 votes
2 answers
964 views

Passing a variable into a get function in order to set dynamic CSS

I would like to have a dynamic CSS where the font color get red if the data exist; I am using a loop function in my HTML in the following way: <template if:true={fulldata}> <...
Ben2pop's user avatar
  • 425
0 votes
1 answer
150 views

Close child Visualforce page from parent visualforce page

We have a child visualforce page that opens from parent VF page using standard controller. We enter some values that needs to be updated back to parent page and close the child VF page. We want to ...
Saaki's user avatar
  • 55
0 votes
0 answers
182 views

Trying to insert 2 records in 2 custom objects which AREN'T in a Relationship via Lightning Aura Component

I am trying to create a record in 2 objects at a time. Object 1 = Guest_Master__c Guest ; its fields =Guest_First_Name__c, Guest_last_name__c, Guest_email__c, Guest_phone__c. Object 2 = ...
Flavia Dcosta's user avatar

1
2 3 4 5
7