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
31 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 ...
1
vote
2answers
2k 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 ...
0
votes
1answer
497 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 ...
0
votes
2answers
46 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 { ...
2
votes
1answer
28 views

How to remove sf form warning

I have this lightning component recordEditForm - <lightning:recordEditForm aura:id="crearAgenteForm" recordId="{!v.recordId}" onsubmit="{!c.handleSubmit}&...
2
votes
1answer
61 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 ...
0
votes
1answer
879 views

Displaying Parent and Detail Records in Lightning

this marks my first step at creating Salesforce Lightning pages and, I'm hoping to be encouraged. I'm able to print the value of acct in the MYAccount class so, I believe my Apex code is okay. ...
0
votes
1answer
93 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 ...
1
vote
2answers
559 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 ...
5
votes
2answers
10k views

How do you set a default value on lightning component force:inputField which is a lookup?

I have a lightning component (Summer 16) which contains a "Task" attribute as follows: <aura:attribute name="task" type="Task" default="{ 'sobjectType': 'Task' }"/> Further down the page, ...
0
votes
1answer
20 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> ...
0
votes
0answers
8 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
650 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
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
1answer
1k views

aura:if inside aura:iteration

I want to conditionally render each item in an iterating list. It has to check if each contact in the iterating list is included/contains in another list of contacts. How should I approach ? ...
0
votes
1answer
126 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
241 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 ...
1
vote
1answer
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 ...
0
votes
1answer
59 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 ...
3
votes
2answers
2k views

unable to get index var from lightning:select option (undefined)

component.cmp <lightning:select name="Version" label="Select a version" disabled="true" onchange="{!c.itemsChange}"> <option value="">choose one...</option> ...
0
votes
2answers
35 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
1k views

Saving Lightning Select Value

I'm trying to display a drop down on a custom component and once a value is selected I would like to update the value in the database. I'm finally able to load the values from the database, set the ...
2
votes
1answer
519 views

Is there a way to react to a related list being changed in lightning?

Simply put, i need to make a lightning component, that depending on related objects to the one whose page i'm in, has different functionality. If the user creates a new related object via the related ...
0
votes
1answer
68 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
61 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
28 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
43 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-...
1
vote
1answer
44 views
0
votes
2answers
307 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
48 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
452 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="...
0
votes
1answer
164 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 ...
9
votes
3answers
10k views

Get records in Lightning web components without APEX

import { LightningElement, track, api, wire } from 'lwc'; import { getRecord } from 'lightning/uiRecordApi'; const FIELDS_SOLICITUD = [ 'DCABM_obj_solicitudABM__c.DCABM_fld_aplicacionSolicitud__c'...
1
vote
1answer
102 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
39 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
42 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
19 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
143 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
255 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
227 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
32 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
170 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
44 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
2answers
308 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
2 3 4 5 6