Questions tagged [helper]
Client side controller principally used to delegate business logic which can be shared accros other controller methods.
86
questions
0
votes
1
answer
39
views
need help accessing the returned value from controller to aura component`s helper class
var action = component.get("c.getCheckType");
action.setParams({"recordId": recordId});
I am trying to call a funtion from Helper class of an Aura controller to apex controller ...
0
votes
0
answers
73
views
Error on previously visited page
im having this kind of error. I want my page to redirect to the last valid page it goes to instead of Account-Show. For example, when I click on a product and I decide to Log-in, after successfully ...
0
votes
1
answer
33
views
what is fourth item we are passing to js method?
this is my code here:
handleKeyUpOnNewRecipient : function(component, event, helper, recipient){
component.set("v.recipients", _.unionBy(component.get("v.recipients"), [...
-1
votes
1
answer
228
views
Pass multiple parameters from jscontroller to jshelper
I'm trying to filter the outcome of my code. Essentially, I have two dropdown menus where I pick values -- user and state. I have no problem working with a single value (user). But can't figure out ...
0
votes
1
answer
172
views
i am writing the helper class and i am getting the error in the helper function itself '=>' expected ts(1005)[Ln2 Col57] What the correct way to write
({
getAccountsHelper:(component,event,helper){
let action=component.get("c.getAccounts()");
action.setStorable();
action.setCallback(this,function(response){
if(...
0
votes
1
answer
192
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 ...
0
votes
1
answer
116
views
Alter code to be reusable across objects?
I'm working on this https://medium.com/salesforce-zolo/build-your-own-teams-feature-for-custom-objects-in-salesforce-963ed3630f4 but trying to instead alter it into a single helper class that creates ...
1
vote
2
answers
70
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 ...
2
votes
1
answer
228
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, ...
0
votes
1
answer
220
views
Passing result from one helper function to another
I am trying to get the org domain in a lightning comp and use that to redirect to the QLE of a record. For some reason, I am receiving undefined on my helper fucntion that calls a nother helper ...
0
votes
1
answer
788
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
1
answer
278
views
In a helper function, is there a way to reference the component that invoked it?
I am new to Salesforce development, so please excuse me if this is an obvious question.
I've developed a number of helper functions for my lightning component. For some of those functions, I need the ...
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 = ...
1
vote
1
answer
274
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"
...
0
votes
1
answer
29
views
Value is not getting populated in Number_of_Enrolments__c field
my requirement is whenever a Student Enrolments are created/deleted the Number of Enrolments field on Activity (Parent object) should be updated to reflect the count.
Helper class;-
public class ...
0
votes
1
answer
1k
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
1
answer
47
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('...
0
votes
1
answer
52
views
How can I call other methods from the current method?
I am trying to do this, but nothing works ... I am a beginner.
//helper js
getDataFromDB : function(component){
let action = component.get('c.getListContacts');
action.setCallback(this, ...
1
vote
2
answers
2k
views
action.setCallback(this, function(response) is not getting executed in Helper class
I have a weird behavior of Helper code in lightning component, where the control is not even entering inside action.setCallback, please suggest me if I am wrong:
JS Code:
doInit: function (component, ...
1
vote
1
answer
2k
views
Error in $A.getCallback() [Cannot read property 'setParams' of undefined] Callback failed When Dismissing Alert Message
I created and displayed a custom list button in standard Lead list view. This references a Visualforce page. Clicking this button makes an action, and there's nothing wrong with the results in the ...
0
votes
1
answer
2k
views
run quick action from batch
I am new to Apex but thanks to the community I learn quickly. I have been looking for a solution to my problem for a few days that is why I am talking to you.
i want to run a custom quick action in &...
2
votes
2
answers
416
views
Date problem in Apex
I am generating current date in the js controller class. And, in the helper class, When I call the Apex method I am sending the date to apex as parameters. Here's the code:
//controller.js
...
0
votes
1
answer
932
views
setCallback returning error state for saving records to salesforce
currently I’ve been following the aura components module in trailhead, with the main variation being that I'm using the Opportunity object, and I’ve run into a road block. For some reason when I try ...
0
votes
0
answers
14
views
Unsure of how to test for both a trigger and helper class [duplicate]
I have a trigger and helper class to populate an account ID on a custom object prior to the record being inserted into the custom object. Can anyone help me with a test class?
0
votes
2
answers
302
views
Show/Hide of a div doesn't work sometimes
I have an aura:component which have two divs inside it. I run a query on my controller apex class and based on the returned value from the query, i want to hide or show any one of the div. Based on ...
0
votes
1
answer
275
views
Not able to replace DoubleQuote from a specific Javascript String in Aura Helper component using Regular Expression
I want to replace DoubleQuote from a specific JavaScript String in Aura Helper component using Regular Expression.
My JS String is ab ","{ cd
I want it to be ab ,{ cd
I am performing this operation:...
1
vote
1
answer
844
views
component.set does not pass value from helper to controller via component
I try to set a value in my lightning component via the helper function, but it does not set the value in the component, and I get the wrong value when I try to do component.get in the controller. Here ...
0
votes
2
answers
1k
views
Aura Lightning Component helper js file change doesn't reflect on client side
I've made changes in the existing Lightning Component helper js file using the Developer Console and saved it. But those changes are not reflecting when I'm trying to use the object associated with it....
0
votes
2
answers
2k
views
How to compare fields of oldMap and newMap?
I have a trigger helper with this method:
public void changeObjects(Map<Id, Cleaning__c> oldObjectsMap, Map<Id, Cleaning__c> newObjectsMap)
But it should make changes only if ...
1
vote
1
answer
39
views
Why is my component's attribute being modified?
I'm building a small component which displays information based on a currently selected object called metric.
Metric Card Component
<aura:component implements="forceCommunity:...
1
vote
1
answer
203
views
Lightning component Service Console, get and edit content of Quick Action Email Message
im trying to develop one Lightning Component for Service Console who is in charge of GET\EDIT entire\parts of Email in Case Management Quick Actions (screenshot) when the user click on the button of ...
0
votes
0
answers
417
views
Data from JSON is not display in my bar chart ? (Lightning component using chart.js)
Here what I am trying to achieve using chart.js in lightning component,
Data comes properly from JSON but Not display like below image
Here is my apex class method,
@auraEnabled
public static ...
0
votes
1
answer
298
views
I want to display two different sucess message for two button in single lightning component
I have two button in same class one is Clone button,another is Renew button,now it is displaying only one sucess message for both button,but i want to display two different success message for two ...
-2
votes
1
answer
4k
views
Run Update Trigger only if a few fields are changed [closed]
I have Trigger and Trigger Helper. My trigger looks like that:
if(Trigger.isAfter && Trigger.isUpdate) {
TriggerHelper.updateTools(Trigger.old, Trigger.new);
TriggerHelper....
0
votes
1
answer
3k
views
How does one populate a Lightning component combobox with a list of records (id/name)?
I have a Lightning component in which I want to display a list of records related to an Account. I currently have this (but it doesn't work):
My Component display:
<aura:if isTrue="{!not(empty(v....
-2
votes
1
answer
33
views
Trigger after insert: can't update a record with no direct connection
I have this construction:
If we create a Factory 2 with InDateTime__c = OutDateTime__c of the Tool 1 with the same Opportunity 1 (with another Factory 1 with the same Opportunity 1 relationship), ...
1
vote
1
answer
2k
views
Lightning components - Button to call a method from the helper?
I'm doing this Trailhead.
Basically, the idea is to have one component that include a form, a button to submit the form, and a child component that display the list of items.
I'm trying to improve ...
0
votes
1
answer
2k
views
How to call a method in a lightning component in same helper
I have a delay function in a lighting component helper from which I want to call another function I get the error [this.displayToast is not a function] how do I achieve this?
Delay function:
...
0
votes
1
answer
3k
views
Apex trigger helper class - deployment error "variable does not exist"
I'm trying to deploy an apex trigger from sandbox to production. But when I test/validate in production I'm getting the error "variable does not exist" for the trigger's helper class:
Trigger '...
0
votes
1
answer
72
views
Helper Uncaught Error
I'm getting this error
Object.verify_trigger_proccess()@https://[COMPANY].lightning.force.com/lightning/r/Account/[ID]/components/c/event_layout.js:79:24
Object.eval()@https://[COMPANY].lightning....
4
votes
1
answer
447
views
Helper method not calling other helper method
I'm trying to break logic into a few separate chunks, but hitting a snag. The basic structure of my helper looks like:
({
foo: function (component) {
console.log(this.bar); // <-- ...
0
votes
2
answers
1k
views
Dynamic row values inherits the values from row before in lightning component
I have a lightning component where in I have a few text fields and 2 picklist fields, controlling and dependent. The problem is whenever I try to add a new row dynamically, the new row will take the ...
1
vote
1
answer
616
views
Call a helper function from within another helper function not working
I am trying to call a helper function from within another helper function, I read on this post that using this from within the helper function should grab the context of the object and I should be ...
1
vote
1
answer
211
views
How to get reference to Component from inside an event method
I have a JavaScript helper method which handles a message sent from a child iframe
handleMessage: function (event) {
console.log('handleMessage');
console.log(JSON.parse(JSON.stringify(event....
0
votes
0
answers
200
views
Lightning Button which Resets the form (uncaught action)
I am currently working on a lightning component which takes the input from a user and let them submit or reset it. Upon submission, the data is fed to an external system and get the results of the ...
0
votes
2
answers
1k
views
Restrict overlapping dates of Opportunities with Trigger
I have an Account and Opportunities for it. These Opportunities have time intervals: Start Date and Close Date. I want to prohibit the creation of Opportunities whose intervals overlap with the ...
0
votes
0
answers
951
views
I am trying to resize my duallist box with help of size option in lightning and it is not working
The size is not resizing the width of the list. Not working as given in the specification.
https://developer.salesforce.com/docs/component-library/bundle/lightning:dualListbox/example
0
votes
1
answer
2k
views
Access Object in Apex Class / Method after passing it from Controller
I (seemed to) have sucessfully passed an object from the client side helper controller into the apex method. However i am having trouble accessing using the dot notation i am used to in javascript and ...
0
votes
1
answer
93
views
Map<String,wrapper> returned from apex class, not received by the helper controller!
I am returning a map value from the apex controller, but the helper controller doesn't receive anything data. Here the system.debug outputs the right values to be received by the controller. Plz ...
1
vote
1
answer
268
views
Bulk upload in Lightning Component not working
we have a requirement where we need to upload contacts in bulk from lightning. We have set the maximum limit to 75k. But when we upload csv, it is considering a file of only 200-300. We need to upload ...