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
1answer
43 views

How to call window.location.reload from Aura component

I have an aura component that needs to do only 1 thing - reload the current window a community (i.e. web browser window, not lightning component using force:refreshView). I am getting errors when ...
0
votes
1answer
37 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 ...
0
votes
1answer
30 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 ...
0
votes
1answer
24 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="...
0
votes
1answer
21 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, ...
0
votes
1answer
17 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-...
0
votes
2answers
103 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. ...
-1
votes
1answer
44 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....
0
votes
1answer
56 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="...
1
vote
1answer
42 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: ...
0
votes
1answer
42 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 ...
0
votes
1answer
36 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. ...
0
votes
1answer
30 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 ...
0
votes
0answers
15 views

Import Metadata Records from Salesforce Schema

What I'm trying to do is to get the metadata record FieldApiName from the salesforce Schema in the next way import MetadataRecord from '@salesforce/schema/CustomMetadata__mdt.metadataRecord__c'; But ...
0
votes
2answers
66 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 ...
0
votes
1answer
78 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 ...
0
votes
1answer
35 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('...
1
vote
1answer
102 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:...
0
votes
0answers
14 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 :)
3
votes
1answer
75 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. ...
0
votes
1answer
29 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/ ...
0
votes
1answer
33 views

Create record from view in background

I currently have a lightning component from which I want to save a string into a record. In my javascript controller I create a record when a button is clicked. A dialog is shown to save the record ...
0
votes
0answers
24 views

Get DOM elements to hide an element from afterRender event in Lightning component

I am trying to access Page related DOM elements which are not part of aura component. I am trying to access elements with the help of afterRender. I am able to get the element but i can see only proxy ...
0
votes
0answers
29 views

How can i assign/Change value to a variable of one JS file into another JS File (LWC)

In LWC, is there any way to change the value of a variable that is located in another JS file & some other JS file changes that variable value which have impact on the first file variable? Regards ...
0
votes
1answer
18 views

lightning:input update time value

I have two time inputs for start and end times: <lightning:input type="time" name="startTime" label="Start Time" min="05:30:00.000Z" max="19:00:00.000Z&...
0
votes
0answers
31 views

Rich text Area Issue- Apostrophe converting to some html tags

How to remove the html tags and get the original content in lightning because in classic it appears correctly but when i switch to Lighting it is adding &" something whenever i am writting &...
1
vote
1answer
1k views

Default a dynamic value in Combobox onload LWC

I am retrieving a set of values from apex through JS, I want to preselect the the first option in the Lightning-combobox (the retrieved values are different for different users). I used @track ...
0
votes
0answers
21 views

Cannot access DOM element from extension

I currently have an extension that has similar functionality to Google's autocomplete. This extension is intended to work in the Service Console in the Email tab (where an agent replies to tickets) ...
0
votes
0answers
38 views

Create Account record with image using Lightning component

I have made a component which will create the Account records, i want to upload image as well along with the rest of the fields while creating the Account record. i tried Lightning:fileUpload, but it ...
0
votes
1answer
75 views

Can anybody suggest me how to implement jquery sparklines in LWC

I have Loaded jquery sparklines static resource downloaded from https://omnipotent.net/jquery.sparkline/#s-news still i cant use functions in it to implement sparklines in LWC this is my html code <...
2
votes
1answer
248 views

Does javascript controller differentiate between double or single quotes?

My JS controller works completely fine when I replace single quotes with double quotes. Does it take both under consideration? Is it just a coincidence? Just wanted to confirm.
0
votes
1answer
43 views

Flatten the Data dynamically

I need to flatten my SObject data dynamically based on another list. fieldToDisplayList contains list of fields to display, which I want to flatten. Using below syntax I'm able to flatten the data but ...
0
votes
0answers
20 views

afterRender CSS isn't initialised

I have this afterRender function: ({ afterRender : function(cmp, event) { this.superAfterRender(); console.log(cmp.find("map_div-ID").getElement().style); var h = ...
0
votes
0answers
85 views

Lightning out App error in callback function When I try to display Lightning component inside a VF Page

Hi I have created a VF page to call a Lightning component. The function of the lightning component is to display value on it based upon the record ID in Lightning page. Now in Classic UI we are trying ...
0
votes
0answers
14 views

Is there any to check scheme url available or not in Salesforce App

Currently I face a problem, my product like follow structure. I want to know if our customer install My App or not, if not I will show a dialog tell him to install My App. I want to ask about is here ...
0
votes
1answer
233 views

Update multiple record edit form records on single button click

I have a requirement where we need to submit multiple record edit form data on single custom button click. Below is my approach for the requirement. I need to save the record edit form data on click ...
0
votes
1answer
520 views

How to Parse return list Wrapper in LWC javascript

I'm new to lwc as well as javascript . I have an Apex class returning List into the Lwc. Method used in LWC: if ( strLastName ) { getAssets( { strLastName } ) .then(result =...
0
votes
0answers
180 views

How to auto populate a picklist field based on the value of another picklist field before the record is created?

In my custom object I have a quick action called "New Rec" I need to know how to auto-populate the Picklist B field value based on other value on the UI itself before the record is created? ...
0
votes
1answer
23 views

Uncaught Action when setting mapMarkers for Aura Component Map

Please note this question is about the Aura Component Map not about a collection of key/value pairs. Specifically, I'm getting an error when trying to set the required mapMarkers attribute on an Aura ...
0
votes
1answer
107 views

Aura component force:recordData picklist onchange event

I have the following markup component: <aura:component extends="c:GenericLightningAuraComponent" implements="force:lightningQuickActionWithoutHeader,force:...
0
votes
1answer
542 views

We added the header Access-Control-Allow-Credentials to true

We load JS code by creating a script tag with dynamic src endpoint and append the script element into the page our src will call resource apex class (@RestResource) I know that Community domain is ...
0
votes
1answer
40 views

Combine two variables in lightning component

How to combine two variable in same variable . I want to get both of values in another variables groupMembers3. const groupMembers = component.get('v.usersToAdd').map(u => u.Id) ; const ...
0
votes
1answer
60 views

How to avoid having multiple values when assigning a variable multiple times

I need to avoid getting duplicate values when I assign a value like this: hoursWorkedHelper : function(timeSheets){ const hoursWorkedByContact = new Map(); if(timeSheets){ ...
0
votes
1answer
237 views

How to declare an account object in LWC js file [closed]

I'm new in LWC and javascript. Can you help me declare a variable account in Salesforce LWC js file. TIA.
0
votes
0answers
568 views

Callback failed Error for Lightning Aura Component

I am facing the below error for the Lightning component. I tried to debug but was not able to find the root cause. This page has an error. You might just need to refresh it. Error in $A.getCallback() ...
0
votes
0answers
60 views

I have created custom lightning chart(bar graph) in lightning component as per the client requirement but getting page refresh Issue

I have put my component inside the object as a tab when open tap inside my component then it will be open bar graph properly. If when I open another record so the component does not show any bar graph ...
0
votes
0answers
182 views

Parameter to apex method is going as null when setting parameter in Lightning JS

I have an add row and save button on a table. When i click on add row, the row gets added and as soon i fill the data and then click on save button, it returns null. After looking into debug i ...
0
votes
2answers
235 views

How to sort Alphanumeric strings in a lightning:datatable on the client-side controller?

I have a field called Elapsed Time (Standard field from Approval Process) in a lightning datatable which is formatted as an alphanumeric string using a helper function. The original data received from ...
1
vote
0answers
241 views

How to update an LWC when a trigger updates a record

I have an existing LWC, we have a community page that holds it and one other LWC (which is part of a managed package we cannot control or edit). The managed component sends and receives data for ...

1
2 3 4 5 6