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
10 views

How to filter a data table on selecting a picklist value in aura components?

So I have got different picklists in my aura component and I want to filter the visible data on selection of some value/values. I have three picklists in my component for selecting values and I have ...
user avatar
  • 1
0 votes
0 answers
21 views

remove popup in aura

I am new to salesforce and learning the aura framework, in that I am stuck at a point where a blank pop-up got opened every time when we clicked on a create PO button, for the past 2 days I am trying ...
user avatar
-1 votes
1 answer
19 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$...
user avatar
  • 1
0 votes
0 answers
40 views

Aura Component-How Multiple actions in DoInit function

I'm working with aura component, I have 2 actions and 2 custom label in my DoInit function (Controller.js file). How can I call the 2 actions and 2 custom label in same DoInit in my cmp file? Here I ...
user avatar
0 votes
2 answers
124 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 ...
user avatar
0 votes
0 answers
41 views

Create a Button Group with Icon and State in Aura Component?

I am new to Aura component, and I am trying to create Button Group that contains an icon and state where the color of the button changes on Selection. The purpose of the button is to return a value ...
user avatar
1 vote
1 answer
27 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 ...
user avatar
  • 327
3 votes
3 answers
214 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);...
user avatar
  • 1,123
0 votes
1 answer
133 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 ...
user avatar
0 votes
1 answer
51 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 ...
user avatar
  • 1
1 vote
1 answer
49 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* ...
user avatar
0 votes
1 answer
54 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 ...
user avatar
0 votes
1 answer
68 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 ...
user avatar
  • 21
1 vote
2 answers
32 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 ...
user avatar
2 votes
1 answer
63 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, ...
user avatar
  • 23
0 votes
1 answer
643 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 ...
user avatar
  • 7
2 votes
1 answer
57 views

How to remove sf form warning

I have this lightning component recordEditForm - <lightning:recordEditForm aura:id="crearAgenteForm" recordId="{!v.recordId}" onsubmit="{!c.handleSubmit}&...
user avatar
  • 23
2 votes
1 answer
103 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 ...
user avatar
0 votes
1 answer
907 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 ...
user avatar
0 votes
2 answers
76 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 { ...
user avatar
0 votes
1 answer
53 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> ...
user avatar
  • 123
0 votes
1 answer
31 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-...
user avatar
0 votes
1 answer
913 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
user avatar
  • 620
0 votes
1 answer
2k 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{ ...
user avatar
  • 333
0 votes
1 answer
42 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 ...
user avatar
0 votes
1 answer
235 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 ...
user avatar
  • 29
0 votes
0 answers
32 views

How to check if the user is inactive for a while in LWC? [duplicate]

I have an LWC in which I'm displaying the list of records in table format(HTML table). It has text, text area, date, picklist, lookup data type in it. I want to call apex class and perform DML if the ...
user avatar
  • 29
0 votes
2 answers
252 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}> <...
user avatar
  • 313
0 votes
1 answer
52 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 ...
user avatar
  • 55
0 votes
0 answers
76 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 = ...
user avatar
0 votes
1 answer
146 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 ...
user avatar
0 votes
1 answer
322 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 ...
user avatar
0 votes
1 answer
51 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="...
user avatar
0 votes
1 answer
59 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, ...
user avatar
0 votes
1 answer
150 views

How does finding nested aura components work?

In my team's code base, there's code of this structure: function() { const first = component.find( 'level-one' ); if ( !$A.util.isEmpty( first ) ) { const second = first.find( 'level-...
user avatar
1 vote
1 answer
120 views

having issue in lightning:input, using this button for uploading file, and want to set null in button without refreshing page after class response [closed]

.cmp <lightning:textarea name="description" required="true" label="Description" ...
user avatar
0 votes
2 answers
908 views

Unable to pass an array from parent LWC to child LWC setter method

Trying to pass a array value from parent component to child component using setter method in child LWC but empty value is being passed to child setter method. I am Using parent LWC as a quick action. ...
user avatar
-1 votes
1 answer
53 views

unable to delete from json array [closed]

I have a JSON array and an array of IDs that needs to be deleted from the JSON array. I have tried to do with iteration but there is always something left in the JSON array. Controller: console....
user avatar
  • 325
0 votes
1 answer
2k views

Trying to take make fields mandatory `lightning-input-field`

I'm trying to make fields are mandatory to fill, but its not working with lightning-input-field How to achieve it with lightning-input-field <lightning-record-edit-form object-api-name="...
user avatar
1 vote
1 answer
220 views

Lightning Component - Attribute loses value

I have a Lightning Component that displays some Categories and the Offers per Category. I want to achieve "Search" in those Categories at first and then at offers. So, what did i try to do: ...
user avatar
0 votes
1 answer
452 views

Aura Component not working as expected

I'm very new developer and I'm stuck. I'm trying to adapt an Aura Component that I found on internet to my needs, but I can't make it work (The original I found works fine). Basically what I want is ...
user avatar
0 votes
1 answer
201 views

Update record on server using lightning component

may I know why this code does not change/update the field object data? By default, the field object (Final_Approved__c) is false. The type is a checkbox. This code is in lightning environment js. ...
user avatar
  • 23
0 votes
1 answer
88 views

value from javascript-controller to be used as global variable in apex controller

i want to pass a string from my javascript-controller to apex controller so that it can be used as a global variable(string) in Apex controller below is the code {.....user is selecting a group name ...
user avatar
  • 47
0 votes
2 answers
428 views

execute apex code from a aura component

Im trying to create a group in a chattool using aura component in salesforce. when i run the code for creating a group in developer console it runs fine. But i want to to execute when user press a ...
user avatar
  • 47
0 votes
1 answer
735 views

How do I convert an object to an array?

I have a searchContact method in the helper. I get from the component a list of contacts of type object and try to convert it to an array. I want to be able, after conversion, to refer to each element ...
user avatar
0 votes
1 answer
37 views

Why isn't the list data being converted?

I have a method that gets a list of data from a database, transforms some fields and outputs them to a table. //helper getDataFromDB : function(component, helper){ let action = component.get('...
user avatar
1 vote
1 answer
451 views

getParam("outputVariables") return undefined

Im using an aura component as an action button to display a flow on lightning experience. At the end of the flow I need to redirect the user to the new record created in the flow. COMPONENT <aura:...
user avatar
0 votes
0 answers
53 views

Object's field value into an aura component

I am not very familiar with aura component. How I get the value of a field into an aura component (more exactly, inside the controller .js of a component)? (Es: status of case) Thanks in advance :)
user avatar
4 votes
1 answer
405 views

Set dynamically Lightning Component Attributes

Currently I develop a Lightning Component, which should show record details based on specific record field values. Therefore I want to set dynamically component attributes based on some record values. ...
user avatar
0 votes
1 answer
80 views

Aura Component / Controller.js debugging : custom follow / unfollow button for Knowledge Article

I have created an aura component to allow client to follow /subscribe to an article. When a user clicks on the button subscribe, a record is created in Salesforce /Record created in Salesforce/ ...
user avatar

1
2 3 4 5 6