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.

80 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
329 views

Passing a variable to lightning component through snapin chat

I have a snapin chat component embedded on our custom application (not salesforce or a community). I'm trying to allow a parameter to pass through to my lightning component for use in the prechat ...
zainogj's user avatar
  • 1,854
3 votes
0 answers
1k views

Cannot read property 'appendChild' of undefined

I want to show the geoposition on a leaflet map lightning component. I enter an Id and get geolocation data accordingly. When I first enter an Id everything works fine, for the second time it shows ...
Tokow's user avatar
  • 31
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
2 votes
0 answers
686 views

controller throwing javascript error

I have a very basic controller function which is for some reason throwing a Javascript error. HTML where controller is called: <lightning:button label="Apply" iconName="utility:magicwand" ...
tom_12321's user avatar
  • 191
2 votes
2 answers
1k views

How to bind 'this' to a function?

In backbone js I used to bind 'this' to function, something like this, this.someFunction = this.someFunction.bind(this); I would like to implement something similar in Salesforce helper function. Is ...
Anto Joy's user avatar
  • 145
2 votes
0 answers
439 views

Embed Lightning component in Leaflet map popup?

I'm using Leaflet inside a Lightning component to map locations of a number of entities. I'd like to display a Lightning component in the Leaflet popup for each entity, and I'm struggling to connect ...
David Reed's user avatar
  • 93.1k
2 votes
0 answers
518 views

JS controller - get all aura:attribute

I've got component with some attributes. For example: <aura:attribute name="missedCalls" type="List" access="global" /> <aura:attribute name="tryingToInitiateCall" type="Boolean" access="...
kratoon3's user avatar
2 votes
0 answers
504 views

ui:inputCheckbox disabled property not working in Microsoft edge

I am dynamically rendering disabled property of checkbox to true or false from controller. This works fine for other browsers but does not for Microsoft Edge. The checkbox remains disabled, i.e it is ...
Sarang's user avatar
  • 2,586
2 votes
0 answers
412 views

How to use Jasmine unit tests and still get past Lightning CLI?

Like the question says, I'm trying to work out some best practices and frameworks stuff with my team. One of the things we want to do is unit test our lightning components. I really like Bob Buzzard'...
api-testuser45690's user avatar
2 votes
0 answers
1k views

Lightning component - Javascript function to fetch picklist values for multiple fields

I built a lightning component where multiple fields with type picklist needs to be shown in the UI. I added a javascript function to fetch the picklist values and also built a generic method where it ...
ləːnə's user avatar
  • 289
2 votes
0 answers
784 views

$A.createComponent throwing error when trying to create the same component for second time

I have to add and remove components from a Modal dialog - so using add code: $A.createComponent("pbrdev:TransactionViewer", { thistrans: ...
Bhuvan's user avatar
  • 163
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
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
1 vote
1 answer
959 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:...
Josue Hernandez's user avatar
1 vote
0 answers
323 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 ...
Salesforce developer's user avatar
1 vote
0 answers
1k 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 ...
ScottH7a9's user avatar
  • 575
1 vote
0 answers
1k views

Map - get key value in aura component

I'm trying to get the key/value pair in the aura component Aura component: <aura:attribute name="countryMap" type="Map" default="{}"/> <aura:attribute name="currentCountry" type="String" /...
Nick's user avatar
  • 7,022
1 vote
1 answer
962 views

Is there any way of hide Navigational items in community upon User Profile?

I have been asked to hide tome tabs from navigation bar on Partner Community when the logged user is Community User. What have investigated so far: Create a custom theme and replace the the layout ...
AjFmO's user avatar
  • 292
1 vote
1 answer
1k views

Change field value in lightning component

I'm trying to change the value of the field Instagram_followers__c of my Influencer__c object in my lighthning component. It's a really simple component: a refresh button wich check the number of ...
Pol's user avatar
  • 113
1 vote
0 answers
1k views

Add addEventListener for blur to lightning:inputField

I want to invoke a method when inputfield is off from focus state(blur). I am trying as below but i am not able to get the alert statement when the cursor is out of focus from field . Can some one ...
Salesforce developer's user avatar
1 vote
0 answers
671 views

Get event source from onclick handler in outer div

In my lightning components, I am trying to create a system that keeps track of every button that gets clicked inside my component. Having an event that fires whenever any button is clicked turns out ...
AlexKven's user avatar
  • 149
1 vote
0 answers
196 views

Wish to prevent agent closing tab in service console

I am trying to find a way to stop agents from closing their tabs in service console if they have unsaved changes in tab. I am using sforce.console.setTabUnsavedChanges to accomplish this. I know i ...
Nitesh's user avatar
  • 63
1 vote
0 answers
1k views

How to close a Salesforce lightning tab like below by use javascript?

I create a button link to lightning component,How to close a Salesforce lightning tab like below by use javascript ?
One's user avatar
  • 85
1 vote
2 answers
3k views

save two records in two objects with a single save button with lightning components

I have two objects: question and answer, in one form. the first 3 fields belong to the question object. dynamic form belongs to the response object. I created two actions in the client-side ...
Reda Dev's user avatar
1 vote
0 answers
2k views

Star Rating in Custom Lightning component

I was doing the trailhead lightning-restaurant-locator And the trailhead is showing how to use Get request so by looping through the response, name and views are in a list. Now I want to add star for ...
U. Ali's user avatar
  • 11
1 vote
0 answers
232 views

How to pas picklistvalues into label lightning component states Discription undefined

I want to pass the picklist values to a label of a checkbox but get error [Cannot read property '$getDescriptor$' of undefined] Here is my code apex controller: @AuraEnabled public List<...
Thomas's user avatar
  • 2,298
1 vote
0 answers
83 views

Lightning Attribute: Get JavaScriptObject

I have a lightning component with this attribute: <aura:attribute name="transportData" type="Object[]" access="global"/> I am getting the data from a http Request: $.ajax({ url: "...
Sebastian Weber's user avatar
1 vote
0 answers
646 views

Salesforce Lightning Component refreshes the entire page

I have a lightning component to add and remove the rows. Whenever I click the delete button, instead of deleting the selected row it refreshes the entire page. This is working fine when I tested on ...
ləːnə's user avatar
  • 289
1 vote
0 answers
185 views

Hide selected value from picklist

I want to hide the selected value from picklist so that in next picklist that value shouldn't appear. I have a grid in which I have 5 picklist so If I have selected 1st value in picklist that value ...
Anzar's user avatar
  • 954
1 vote
1 answer
444 views

How to solve race condition between afterScriptsLoaded and doInit in component

I'm working on implementing a map component with leaflet that needs to do two things. 1) Upon initialisation, get a list of the locations from the server 2) Once js libraries are loaded, use list of ...
adam.sellers's user avatar
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
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
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
2 answers
479 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
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
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
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
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
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
0 votes
1 answer
114 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
227 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
0 votes
1 answer
491 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. ...
Atiqah's user avatar
  • 23
0 votes
0 answers
199 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 :)
Accursio Maniscalco's user avatar
0 votes
1 answer
207 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/ ...
Hermann Ouré's user avatar
0 votes
0 answers
285 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 &...
user91530's user avatar
0 votes
0 answers
828 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 ...
maaz ahmed's user avatar