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
0answers
7 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-...
0
votes
1answer
45 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
0
votes
1answer
90 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{ ...
0
votes
1answer
28 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 ...
0
votes
1answer
44 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 ...
0
votes
0answers
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 ...
0
votes
2answers
32 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}> <...
0
votes
1answer
18 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 ...
0
votes
0answers
42 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 = ...
0
votes
1answer
58 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
38 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
24 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
33 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
217 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
45 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
218 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
84 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
97 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
38 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
36 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
17 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
111 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
178 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
182 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
25 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 :)
4
votes
1answer
125 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
38 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
54 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
42 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
36 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
37 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
51 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
2k 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
22 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
130 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
79 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
317 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
53 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
23 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
137 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
17 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
262 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
782 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
229 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
35 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
176 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
614 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 ...

1
2 3 4 5 6