Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [helper]

Client side controller principally used to delegate business logic which can be shared accros other controller methods.

0
votes
1answer
22 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 ...
0
votes
1answer
32 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 ...
0
votes
1answer
19 views

Reference a controller function for a dynamically created DOM element

In my helper, I have a function that is dynamically creating multiple . I want the onclick event to trigger a controller function : I tried the following code : accordionWholeDiv.setAttribute('...
1
vote
0answers
50 views

showToast is not working in iOS device

Here what i have written code to display 'showToast' message in lightning component and It's not working in iOS (but yes it working as expected in Android and Web). handleFpAdd: function (component, ...
0
votes
1answer
23 views

Calling the trigger by class Method

I write a trigger on case for avoiding duplicate case by updating case status to "Duplicate". This Duplicate is manually inserted in picklist. I have to write Helper & Test class for this. Class ...
1
vote
1answer
290 views

How to call helper method from a different lightning component? [closed]

I have lightning component A and lightning component B, in lightning component B there is a helper method X, how to call helper method X in lightning component B from the helper in lightning component ...
0
votes
0answers
23 views

How can I create generic helper methods that can be used accross multiple components? [duplicate]

I want to create a function that can be used across lightning components.
3
votes
1answer
91 views

Dynamic Button Icons in a Data Table Similar to Dynamic Actions in a Data Table

It's possible to have actions for each row in a data table that change depending on the contents of the rows (that are changed by those very actions). For example: The component reference provides ...
1
vote
1answer
45 views

Lightning Application Event Seems to Refuse to Fire

Event: <aura:event type="APPLICATION" description="Event is fired when boat type is changed in the BoatSearchForm component" > <aura:attribute name="boatTypeId" type="String"...
3
votes
1answer
40 views

Lightning updating 2 attributes when only 1 is updated

I have a lightning component that has 2 attributes and in input. <aura:attribute name="wrapperObj" type="Object" /> <aura:attribute name="originalWrapperObj" type="Object" /> <input ...
1
vote
1answer
37 views

Passing an object parameter, containing employee enroll form on a Helper to Apex method in lightning

Currently, sending a Employee enroll input form on a object H_HRBasic__c to the apex class method CMP <aura:attribute name="HRB_S" type="H_HRBasic__c" default="{'sobjectType':'H_HRBasic__c', ...
0
votes
1answer
28 views

How can I test Messaging.MassEmailMessage with checking targetobjectids?

We have some User with UserRole. I need to verify that the email has been sent to the user with the role 'TestRole'. How can I do that? I try: List<Messaging.MassEmailMessage.targetobjectids> ...
-3
votes
1answer
34 views

Test class with different scenarios for trigger helper

I have 100% coverage, but I still haven't scenarios for check. How to write good and bad scenarios for test class? This is my helper: public with sharing class JobHelper { public static List<...
0
votes
2answers
33 views

Can I avoid a code duplication here?

I have a code duplication here. How can I fix it? I want to make my code better. Helper: public with sharing class JobHelper { List<Task> taskList = new List<Task>(); public void ...
0
votes
1answer
42 views

How to make more methods in Trigger Helper class?

How can I make more methods in this Helper class, not just public static void? I also need a method for checking the update of Stage__c field (when we update another fields - Trigger shouldn't be ...
1
vote
1answer
99 views

helper method is called recursively

I'm trying to fetch the list of opportunities related to the account(called as Student in my case) selected(from dropdown list). I have 2 buttons with different aura:ids what I want is, when I click ...
0
votes
1answer
31 views

How to merge these two map into one map?

Set<ID> folderIDS = new Set<ID>(); Map<ID,Custom_Folder__c> foldersToUpdate1 = new Map<ID,Custom_Folder__c>(); Map<ID,Custom_Folder__c> foldersToUpdate2 = new Map<ID,...
1
vote
2answers
128 views

Show checkbox while loading component

I have used Check all / Uncheck All checkboxes function to select group of Values. I used to display some data in aura iteration with checkbox values checked. If the data row is more than one its ...
0
votes
0answers
162 views

Passing apex class as a parameter from lightning component to apex class

I want to pass apex class as a parameter from lightning component to apex class method.When I tried, I am getting error as "Error message: An internal server error has occurred Error ID: 124770038-...
0
votes
1answer
53 views

triggers and helper class to update quoteline items from account

trigger ct on Account (after insert, after update, before insert, before update) { Set<Id> accIds = new Set<Id>(); Set<id> oppIds = new Set<id>(); for(...
3
votes
0answers
123 views

Global window object in lightning helper

After getting an answer to Preserve a JavaScript variable between component calls of the client-side code question (which says there is a separate wrapper object around the browser's window object for ...
1
vote
2answers
305 views

Client side logic that is executed when a user hovers over an Account in the list should be stored in which bundle member?

While preparing myself to the Developer 1 certification I met the following question: A developer created a lightning component named accountList.cmp that displays a list of Accounts. Client side ...
0
votes
0answers
217 views

$A.createcomponent not working as expected

I'm creating a component that, based on a custom fieldset, generates a form. The point is when is trying to create lightning:select, lightning:duallistbox and lightning:textarea the $A.createComponent ...
0
votes
1answer
55 views

How to set attribute.Metadata field in .callServer with Javascript Var?

I tried to get the description of the title correct. If you think there might be a better one that describes better the scenario, please suggest! In lightning components, I have a cpq_Configure ...
4
votes
1answer
368 views

Helper Method undefined when called from dynamically created component

Using examples from the developer documentation Dynamically Creating Components, I am attempting to create a button dynamically (which I should be able to select in order to create a new component ...
0
votes
2answers
3k views

Check if certain string exist in my enum values - salesforce

In My ENUM a list of values is added and I need to check if certain string values are in my ENUM and which is dynamically checked through a loop. public Enum KeyValues{CaseNumber, Name, OwnerId, Id} ...
0
votes
0answers
33 views

Lightning Component: Need to show the preselected data at top of the list

Hello Guys on the load of component i am preselecting the contact from the user log in now i need to show the checked contact at top of the contact frame and rest of the list sorted by last name as it ...
0
votes
1answer
2k views

JSON parsing and aura iteration in salesforce Lightning

Below is the link of format JSON example I am trying to bind the data which is there in results-> items using aura:iteration. Here is my code for that. <aura:iteration items="{!v.newassets....
2
votes
1answer
2k views

Can I do multiple functions in one Lightning Component Controller?

I have tried to put multiple functions into the one Component Controller unsuccessfully. I then created a helper class that the Component Controller calls and will run the different methods. This was ...
4
votes
1answer
369 views

Packaging custom labels used in lightning helpers and controllers

So in our lightning code base we usually refer to labels from js helpers and controllers as the following (it's static reference, not dynamic one): $A.get("$Label.c....
15
votes
1answer
8k views

Help me to undestand this lightning helper methods (reduce & showHelpMessageIfInvalid)?

I went through the lightning guide and try to learn the form controls, I got the below code which show that it validates the form fields, But would like to see more insight on 1 reduce - what this ...
1
vote
1answer
282 views

Get component in helper class from current context in Lightning

As we all know helper methods in Lightning usually have the following signature: openAffiliationCreateDialog : function(component, event) { ... } My question here, is it possible to stop passing ...
1
vote
2answers
3k views

Adding onclick to dynamically created button

I have a component that dynamically creates buttons which, when clicked, apply filters and then re-query the back end for data. While I can assign onclick events to each button, I can't find a way to ...
2
votes
1answer
2k views

calling helper method from inner function in another helper function (same helper) in lightning component

I have this code in component helper: func1:function (component){ var element = component.find("calendar").getElement(); $(element).fullCalendar({ views: { ...
2
votes
1answer
160 views

Salesforce Simple Syntax Error

I am working on a very basic lightning App that will return (for cases) a list of cases that have the same contactId associated with them. I'm following this trailhead as an example and modifying for ...
6
votes
2answers
716 views

Is it OK to have variables in a Lightning Component Helper

I'm working on a drag + drop application in Lightning. I've worked up my solution by having a wrapper component, FormDraggableElement, which goes around anything that I want to be able to drag around ...
0
votes
1answer
236 views

How to assign salesforce value to standard lightning component

How to show Salesforce data into a dynamically created standard component. I'm dynamically creating ui:inputText field which is used to display Custom Object value in UI. How can I display field value ...
0
votes
1answer
395 views

Need to change Value on every value change in lightning component

HI I Want to Change Result(Servicevalibility) value as soon as there is any change in Input Fields.But,Now its changing only when i change the value and press tab key . Component - ...
0
votes
0answers
358 views

Trigger to update all the Child records in the hierarchy based on parent record

I have a Cusotm object which is used to save assets. There is a Self lookup relationship field called "Parent Asset ID" on this object and using this relationship, we create a parent-child ...
3
votes
1answer
6k views

Use existing Lightning component in $A.createComponent

I wish to make dynamic aura:id's and for that i want to use $A.createComponent, now i already have a component called 'pageComponentCard' that i wish to call but i can't do this. The code in ...
3
votes
1answer
3k views

Helper method error: says is “Not a function”

I'm trying to implement a helper method in a Lightning component, but the error that comes up is: "This page has an error. You might just need to refresh it. Error during init [Action failed: c:...
1
vote
1answer
506 views

Lightning Helper how to include js files?

I have a js file(inside the folder of a component) that has a bunch of objects that hold properties on them. I want to access this file from an aura helper but I am not sure how to import/include it. ...