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.

0
votes
0answers
17 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
25 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
26 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
19 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
25 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
27 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
19 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
22 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
26 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
39 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
31 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 ...
-1
votes
1answer
24 views

Create a .html file for users to download [closed]

Here's the data model: There are two objects: Tests and Bugs. Bugs is a child object of Tests object. So users can use this app to create tests and bugs under them. After a test is complete, users ...
0
votes
2answers
42 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
78 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? ...
1
vote
0answers
33 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
33 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
73 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
44 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
25 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
22 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
16 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
34 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
32 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
148 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
50 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
89 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
82 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
19 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
0answers
22 views

How to fix the button with rendered? No actions there. Why?

I don't know why I get a blank status when use delete button with rendered? And it can't delete the record too. I need to hide delete button, if status!='Posted'. With post button all is ok, but with ...
0
votes
1answer
39 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 ...
0
votes
1answer
35 views

I'm new to VF and apex. Trying to create a custom clone functionality.

Unable to pass contact from VF to the controller. I have to check if the contact is inactive on VF page if it inactive, allow user to change the contact and pass the changes to the controller. If ...
-1
votes
0answers
27 views

Run flow in APEX class

I've created a list button for cases, and I´ve included it in accounts related lists. The button has a visualforce page as its content resource, where I run my flow for creating a new Case. The idea ...
0
votes
1answer
24 views

Apex read from multiselect SelectList in Controller and multiple for loops

I trying to post something to a Facebook page using my own API.The Visualforce Page gets the Facebook Page info and displays a checkbox. The user then selects the Pages and clicks Submit. Here is my ...
0
votes
1answer
21 views

Assigning Case Owner on opening a Case

We have Email-to-case implemented which is assigning new cases to a Queue. Now whenever a user opens a new case, it should be assigned automatically to that user. For this I have written a VF page ...
0
votes
1answer
39 views

'Last Viewed By' Account field test - System.QueryException: unexpected token: 'null'

Trying to create a Last Viewed By field on Account. I'm newbish at Apex and not seeing what I'm missing here... I'm sure it's a rookie mistake. Adapting code from http://www.sfdcpanther.com/setting-up-...
0
votes
0answers
29 views

how to do multiple coloumn sorting dynamically?

I want to do sorting in multiple coumns like. i am able to do sorting on one column click in complete table but not able to do sorting different columns in different sections. like this is my data ...
0
votes
0answers
21 views

how to sort different different wrapper list dynamically?

i want to sort the wrapper class where i have different different list of wrapper class. i want to do the sorting that different different wrapper list hold different different value, i am able to do ...
0
votes
1answer
20 views

Based on Recordytype-selection i need to show or hide some values in standardcontroller and extension

When i change the record type value(technical or no technical) , i need to hide/show email__c, isClassTeacher__c and i need to show filtered picklist values based on record type selection for the ...
1
vote
0answers
37 views

Controller & Page data architecture [closed]

Does Salesforce Visualforce page have the ability to show table like this: For example, the data is Map, where key is Employee and Value is List of reports. Table should show which employees didn't ...
1
vote
1answer
31 views

What kind of test can I write to check the file?

I have a controller for VF Page. This code upload a profile's image (we can see it after that) and delete it. What kind of test can help me to check this file? I need to know, is it uploaded or not. ...
1
vote
2answers
48 views

Visualforce getters are called before setter when selecting a select option

I've noticed that when I have an <apex:selectList/> with a value attribute that calls a setter method to set a value in the controller all my getters get called before the initial set call ...
0
votes
1answer
36 views

get value from iFrame to visualforce script to controller

I am showing different domain website on iFrame window in my visualforce page. There is a button on that website "SAVE" (let's say). Once cx clicks on save button, I should notify too. How do I get ...
1
vote
1answer
69 views

Visualforce Input Fields not being passed to Controller

We're running into an issue where values being entered into a Visualforce page are not being passed at all to the controller for the save actions that take place. I'm sure this is something simple ...
0
votes
0answers
33 views

Save uploaded image even after page refresh

I need to make an VF component with image. All is great, but this image (preview) disappears after page refresh. How can I fix it? Controller: public class uplClass2 { public string recId{get;set;} ...