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 [controller]

A controller is one piece in the Model-View-Controller (MVC) architecture of Visualforce. A controller can be a standard or custom controller and extensions to controllers can written.

1
vote
1answer
44 views

How get a value from a Visualforce page and pass it controller before calling the controller.save method?

I'm having the following snippet in the VF page: <apex:inputField id="reason" value="{!case.reason}" required="true"/> which is displaying some case reasons for me. By calling the following ...
0
votes
1answer
29 views

How to access a dynamically generated html class name from a JS controller?

I was trying to concat a class name with index from the iteration component. If it's correct, how can I access this value from the JS controller? Component: <lightning:overlayLibrary aura:id="...
0
votes
0answers
29 views

Lightning Error Message Question

I'm trying to create my own Account Hierarchy link that displays more than 500 accounts and its children utlizing lightning componenets and lightning out. I keep recieving this error whenever testing ...
0
votes
0answers
46 views

Apex heap size too large: 6125236

I have a visualforce page which is throwing me the error "Apex heap size too large: 6125236" I have referred to couple of similar issues here on stackexchange but this seems to be a different issue. ...
0
votes
1answer
20 views

is actionFunction or jQuery init function running first?

I am now responsible for a chunk of code that is big and old enough that no one is certain how it works. I have a few questions I'm hoping you can help with. I have a page called PolicyDetails.page ...
1
vote
2answers
29 views

Adding a new method to Controller of Lightning component resulting a constant error

Every time a new server-side method is added to existing component that has controller tag and it's successfully calling other methods in the same class, that component has an issue with recognizing ...
0
votes
1answer
37 views

unable to save record which is created through vf page

I have created vf page for new record creation of custom object. when i click to new button i am gettting vf page where based on case field value (i.e. CaseNumber) i am able to prepopulate other ...
0
votes
0answers
29 views

Dynamically created HTML : link onclick to Controller function

I'm creating some HTML elements in a helper function, and dynamically appending them to the DOM. There is no problem in this step. The only problem I can't solve is the creation of the onlick ...
0
votes
1answer
22 views

Display save success message only when the record is saved on VF page

I've a VF page to create cases. It has lot of workflows and VRs associated with it. While saving a record, if there's a VR error, the message shows at the top of page, however, I'm also able to see ...
0
votes
1answer
28 views

need help on writing test class for controller

i have controller for vf page, i have written a test class. test class is having two methods where i am succesfully able to run the test for Autocal but for Save method i am getting following error ...
1
vote
1answer
53 views

How to redirect to a record page?

I have a custom VF page in a section in the Lead layout. The page is showing a table with specific information. When I clink on the link I expected to see an account record page. The link is not a ...
0
votes
1answer
26 views

Want to use Html Rich Text in Vf Page

I created a html body in controller class of Visualforce page and want to show that table on vf page. To make that happen i used <apex:inputTextArea label="RichText" styleClass="slds-select" value="...
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
22 views

How can I re-render a visualforce form to collect different fields?

Scenario I must Collect 40+ fields worth of information on an visualforce form. This must be broken up on multiple pages instead of one long page. Story So Far and Research The form dynamically ...
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
votes
0answers
16 views

I want to create a test class using this code,.Anyone help me in this one?Thanks [duplicate]

public class AccountSearchController1 { //main class //results variables public Boolean hasResults{get; set;} public List<accountSet> resultSet {get;set;} public List<...
0
votes
0answers
19 views

how to conditionally render a gauge chart based on values of a numeric array in Visualforce

controller--snippet if(pos >=0 && pos <assTElist.size()){ lstTrans = [select Maturity_Assessment_Question_ID__r.Transformation_Element__c fa, ...
0
votes
2answers
35 views

can we use multiple extensions with custom controller

My first doubt is can we use multiple extensions with custom controller. If yes, please check below code and let me know can I call "dosomething" method of Ext2? Ext1: public with sharing class Ext1 ...
0
votes
2answers
35 views

Second apex method executing before the first one finishes

I have a vf page displaying several Multi select custom buttons. And I am calling a apex method every time one of the button is clicked from VF page using actionfunction. But if I click 2 buttons in ...
0
votes
2answers
29 views

How to create a condition for apex:inputField value field which gets a boolean expression from a method from controller?

I have the function which returns the boolean value and I want to use it in the VisualForce page in the following way: <apex:inputField id="reason" value="{!if(!isReason()): Case.Reason__c = 'No ...
0
votes
0answers
31 views

Getting parent Id when clicking new button from related list

Object A is the parent object and object B is child object. object B has new button override with VF page. when I am clicking the new button of obj B from related list A I need Obj A's Id. For this I ...
1
vote
1answer
28 views

Lightning components - Initiating App attribute with controller - Issues with format and transmission

I'm Working on Lightning components I would like to add some values in my App, using its controller (aura:handler) But it doesn't work at all, so the default values of my component is displayed at ...
0
votes
0answers
21 views

How to implement managed package interface?

I have installed a manage package in my sales force org. Package has given an interface to override/add custom business logic. It was working great with the below code. global with sharing class ...
0
votes
2answers
23 views

related fields of contact are not auto-populating on case vf page

I have created a custom button "Create Case" on case for community user portal, where user when click on that button it will redirect to vf page. On that vf page i am having a field Contact name, ...
0
votes
0answers
37 views

Uncaught Error in $A.getCallback() [chartDataProviderName is not valid] Callback failed: MyController/ACTION$getChartData

Hi I am getting the following error. Uncaught Error in $A.getCallback() [chartDataProviderName is not valid] Callback failed: apex://MyController/ACTION$getChartData .cmp file <aura:...
3
votes
1answer
58 views

How to share Visualforce page (<apex:page/>) controller with multiple child components (<c:componentName/>)

I have a Visualforce page that is essentially a form with 8 steps. It uses a custom controller. I have recently moved each step into it's own component (8 in total). Now what I am wondering is, can I ...
1
vote
1answer
37 views

Querying User table from Community Super User profile in Communities

I am trying to query the user table from a controller called by a lightning component in Communities. User usr = [SELECT Id, Name, Email, Phone FROM User WHERE Id IN (Select OwnerId From ...
0
votes
2answers
117 views

Getting an “Invalid Definition for Null” error when trying to associate controller with component

I'm creating a lightning component named "scroll" and a controller file associated with it. Here's the opening tag of .cmp file: <aura:component controller="scrollController" implements="force:...
1
vote
3answers
81 views

Make fields mandatory when status is complete

I have a status field on contact,when status is complete,remarks should get mandatory..I wrote if condition for this in controller,but it is not taking remarks field as mandatory..how to write this? ...
2
votes
0answers
52 views

what is “quickcard” in salesforce?

Use the quickcard (section “Import an Object”) to require ISML and guard in your controller. i can't find quickcard keyword in eclipse and what is meaning of quickcard in ecplise . The first bold ...
0
votes
2answers
39 views

Form In Arabic Language With Picklist Values In Arabic As well

Hope all of you are doing good. I want to create a visualforce page (form) which will take input and submit in database but this should be in Arabic. Everything inside form should be in Arabic ...
0
votes
1answer
161 views

How do I use Blob to create a PDF in my apex controller and use it in my Lightning Component without using VisualForce Pages?

This is the apex controller: public class pdfGenerate { public static final Integer limitRecords = 10; @AuraEnabled public static Blob generatePdf(){ List&...
0
votes
1answer
17 views

how to retrive /fire a link from a cutom object field

I am storing the public url of a pdf file in a field of a custom object. I am able to successfully retrieve the url. how can I fire the url when a user click a button? Is it possible through JS ...
1
vote
1answer
34 views

Can't access related record in test

I have a visualforce page which is displaying a list of opportunities. The page is working as expected - no problems. The problem is that when testing I can't access the account which is ...
1
vote
2answers
48 views

Get type of record from standard controller without accessing record?

I've got a component which is used on multiple object types in their visualforce pages. I have a controller which provides some data, and another to add some relevant fields. The controller which ...
2
votes
1answer
29 views

Visualforce Re rendering issue

I have the following VF Page and Controller. The VF Page will have a dropdown of territories, and when that dropdown has a value selected, then I would like to render the PageBlockSections to show ...
0
votes
1answer
43 views

How to make internal click to apex:commandbutton with setTimeOut and onLoad Or Document Ready?

Well, I've been struggling the whole day to make this happen. I have a custom button, that calls a custom VFP, this VFP has an apex:commandbutton, that sents an email (method from the controller) and ...
0
votes
1answer
18 views

Test Class for Visualforce Controller Test Class Coverage

I have a simple Visualforce page with a simple controller as follows public class EDU_CustomController_Getter { private String sortOrder = 'LastName'; //This is the getter method used to parse ...
1
vote
1answer
17 views

How to save list of text from visualforce to controller?

I am trying to populate a list of answers. I have a list of questions and an empty array of answers that I pass to a visualforce page. The code in my visualforce page is: <apex:variable var="index"...
0
votes
1answer
30 views

Salesforce test class for controller extension

I think I made the test in the right way, but coverage still 31% public class ContractMilestoneInfoApex { public List<Milestoneinfo> MSIList {set; get;} public Milestoneinfo MSI {set; get;} ...
0
votes
1answer
67 views

How show selected RecordType in custom Visualforce Page?

I had to override the New button to use a clone of the record page of a Custom Object, so far so good, now I need to be able to catch the record type selected like in the original page. Original: ...
0
votes
1answer
36 views

Adding custom components to dynamically created table row tr

I have a custom component which by the means of a button add a row to my table. Now my needs are to add a component to each entry (tr) of the table. This is my controller: var tBody = ...
4
votes
2answers
175 views

How can I make a lightning component change as the underlying data changes without refreshing?

I'm writing a lightning page that allows two players to remotely play chess through the same lightning page. The page uses the aura framework. For what I've already implemented, the Game__c object ...
0
votes
1answer
64 views

Pass method from controller to javascript

Could you please to help this? I'm very new with javascript.I have tried many way but it doesn't work. I have problem with javascript function I have tried to call method from controller but it doesn'...
5
votes
2answers
100 views

Maintain state in Visualforce Page without using View State

I would know if there is some way to maintain state across different transactions without using View State. For example, if in my Custom Controller, for every action method, I need 100 Account's ...
5
votes
1answer
121 views

Recursive Call in controller Lightning

I want to make recursive call in js controller on my lightning component.. Following is my js controller but I am getting an error as 'callback' must be a valid Function check : function(...
0
votes
1answer
26 views

How to fix wrong test controller's filter by status?

public void byStatus(){ //Temporary multipicklist, because my main picklist isn't multiselected: String temporary = jobAdvertisement.Temporary__c; List<String> temporaryList = new ...
0
votes
1answer
20 views

Need to get the error message from the Controller to Display reply OK and there is an error

this is now working fine but the problem in this it not recognizing the errorMessage attribute from the controller. I need the confirmation page - working now if the user press OK and there is a ...
-4
votes
2answers
31 views

Running apex batch from controller with parameter [closed]

This is my controller. public class vfcontroller { public Date startdate{get;set;} public Date enddate{get;set;} public PageReference submit() { System.debug('@@@1'+startdate); ...
0
votes
1answer
41 views

rerender output panel to display the update list

I have a page that iterates a list object to display the records. Once clicked on save, I updated the same list with new values and debug logs shows the update list but output panel is not rerender'ed ...