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
47 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
22 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
52 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
77 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,709
-2 votes
2 answers
43 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
0 votes
0 answers
115 views

Retain Picklist value field on Lightning Component coming from Screen Flow

I have below scenario : I have a quick action on Order for "Cancel Sales Order" which pops up screen flow it has 2 sections , 1st section is an aura component which has 2 picklist fields ( ...
Salesforce Dev's user avatar
1 vote
1 answer
63 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
1 vote
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,763
0 votes
2 answers
244 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
79 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
328 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
676 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
  • 431
0 votes
2 answers
2k 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
58 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
1k 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
42 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
153 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
88 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
175 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
496 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
499 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
  • 111
-1 votes
1 answer
180 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
5k 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
134 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
  • 342
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,265
1 vote
1 answer
703 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
587 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
369 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
192 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 ...
Tyler Edmonds's user avatar
0 votes
1 answer
212 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
68 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
227 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
1k 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
129 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
162 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
191 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
291 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
89 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
  • 75
0 votes
1 answer
4k 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
  • 808
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
  • 399
0 votes
1 answer
783 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
856 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
  • 39
0 votes
2 answers
881 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
  • 395
0 votes
1 answer
136 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
0 votes
1 answer
307 views

How should I escape the comma "," while forming the URL in lightning aura component

In my lightning aura component: I am using below code to open a pop up for New user record creation and I am passing default field values to be pre-populated from another object, I am able to get the ...
Little-Late's user avatar
0 votes
1 answer
790 views

Apex method's callback Response.state is 'undefined' when calling function from lightning component's controller

I am new to Apex and Lightning so what I am doing may not be the correct way to accomplish this task. I am building a custom lightning component (CreateNewMailDrop.cmp) with a button. The button click ...
Alex Birutis's user avatar
0 votes
1 answer
113 views

Drag Drop records in canvas giving error Aura lightning

I am trying to display all records in a card format and trying to drag and drop it in a canvas. When i am trying to drag an element its giving the below error <aura:component controller="...
user2542953's user avatar
0 votes
1 answer
189 views

Information about event in JS controller in AURA

I would like to know where I can get relevant information about the methods that have the event of the aura controller, i.e. this my_function: function(cmp,event,hlp)... I know a lot of the others, ...
Leo Monsalvo's user avatar

1
2 3 4 5
7