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.

learn more… | top users | synonyms

2
votes
2answers
18 views

Passing a value from a VF Page to Controller

I have been working on this on and off for quite sometime now, and have hit a wall. So what I'm trying to do is pass a Super Customer to my controller where it will get picked up and pushed over to ...
-2
votes
0answers
31 views

I need help in writing test class for custom controller [on hold]

The below code is a custom controller which inserts a merchandise record into the database when the SAve button is clicked. public class MyCustomController { public Merchandise__C merchandise { get; ...
0
votes
1answer
32 views

View State and Heap Size too large

I am trying to execute this Apex code but getting view state size of 196 KB and Heap size error. I tried to find where the bulk of view state is going to and it seems to be this controller. Could ...
0
votes
1answer
18 views

Constructor not invoked for Custom Controller. Any suggestions of what is wrong?

I have built a custom controller and the constructor does not automatically invoked when the page is executed. What could be wrong in this? Am i missing something? The System.debug('Inside ...
1
vote
1answer
30 views

APEX Unit tests hello world

I am trying to learn how to do APEX testing but all the tests in the documentation are too complex and I can't find an example of a simple APEX Controller that is a Hello World Test. I have this APEX ...
0
votes
1answer
17 views

Page lifecycle reading query parameters and executing

I have a working view and controller. I've added a custom link to accounts/leads that passes the id and type in the query string to an page and here the controller should then load some data according ...
1
vote
1answer
22 views

VF Controller search logic

The following is my controller for my VF page that is going to search for certain Super Customers. On every Account there is a field called Super_Customer1__c, and since Super_Customer1__c will often ...
0
votes
0answers
34 views

Saving Dynamic rows to an Object on checking the checkbox

I have an Order Object , Product and a Junction Object OrderProduct. I have used as inline vf in Order Detail page and I want to capture the Product Details in that Inline VF and then save the Order ...
1
vote
0answers
28 views

Requirement in Visualforce and apex

We have total 9 steps, In step 4 : We have some check box options like A, B, C, D , E, F, G. We have selected A B C D In that we have two fields like unit level (text) and service level (Pick list). ...
3
votes
2answers
94 views

Display header and footer in all PDF pages using VF

My vf page <apex:page renderAs="pdf" Controller="testpdf1"> <head> <style type="text/css" media="print"> @page { size: 8.5in ...
1
vote
2answers
22 views

Calculating Fields in Controller - Better Ways?

Thanks for your eyes on my issue. I'm hoping to get feedback on a better way to approach a solution! Here's my situation: I have a Visualforce page and corresponding controller that looks at a series ...
0
votes
2answers
22 views

VF Controller Test Class

I have been trying to create a test class for my controller for my visual force page and I am not grasping the concepts behind it, can someone help me get started? I have tried a few things but I have ...
1
vote
3answers
44 views

Method does not exist or incorrect signature: [String].getDescribe()

I've checked the other answers and googled alot, cant seem to find the answer to why this doesnt work: public List<SelectOption> AccountIndustryOptions = new List<SelectOption>(); public ...
2
votes
2answers
19 views

how to search a child record based on parent name in sosl

I have a search VF page (it is just like google search with text box). In this i am searching all fields of a object then retrieving records by sosl search (upto this functionality it is working ...
1
vote
1answer
18 views

Share (wizard-like) state between page with controller extension and page with controller

I have a custom VF page to create new or edit records of Type CustomObject__c. Via a Linker__c object such records can be related to other OtherCustomObject__c. To create such links I have a button ...
0
votes
0answers
12 views

Insufficient Privileges

I have picklist of values Lead and Opportunity, By default value of picklist is lead when I change change it to opportunity and again if change it to lead, it gives error of Insufficient Privileges.
0
votes
0answers
42 views

Incorrect code coverage in developer console

I have an apex class called RelationshipTreeController (RTC for short) and a test class called RelationshipTreeControllerTest (RTCT for short). I have written a test method that calls the search() ...
0
votes
0answers
20 views

Visualforce save all records with inline editing, sorting and filtering

I need to build an editable grid of a custom object with sorting and filtering and be able to save all edits. I was able to build the editable grid of the custom object like in this link. Then, to add ...
3
votes
2answers
30 views

Why is my locked record editable?

Why is my record locked? The record that the class below creates, when shown in detail view, has the 'locked' icon, and appears to be locked at first view, but- Why can I edit the locked record (Even ...
4
votes
1answer
86 views

How can I use the html (pass through) attributes in Salesforce

I have create a VF page which is accessible on mobile through which I can take pic and attach it to the selected record. For this I have created a input tag in html <input type="file" ...
0
votes
2answers
41 views

I can't execute a simple batch class in my controller

I was about to use a batch class and now I'm stuck cause It wont execute. I don't know why. Here's the code from my controller class: public ConstructorName(){ dispForecastSummary(); } public ...
0
votes
2answers
17 views

Sorting a list of checkBoxOption Error: One or more of the items in this list is not Comparable

I am attempting to sort a list a list in my class however I am running into the error above. The list comes from a method in another class. public static List< vCtrl.CheckboxOption> ...
0
votes
0answers
24 views

can we update the related list object data with standard controller as master object?

I have two objects quote and quotelineitem master is quote and related to quote line item quote---->quote line item Visualforce page : I have kept like this <apex:page ...
0
votes
0answers
12 views

when downloading last page of results not getting downloading here i am using Pagination Concept in VFpage

do{ for(Inv__c ip:(List<Inv__C>)EquipCon.getRecords()) { totalInvestList.add(ip); } Equipcon.next(); ...
2
votes
1answer
24 views

What is the use of calling a controller inside an APEX trigger? Is that a best practice?

I saw some posts related to APEX triggers and recently one below, Salesforce method to update doesn't get commited in which the trigger have few lines, ApexPAges.StandardController sc = new ...
1
vote
1answer
32 views

How to write test class for a controller with non dml statements

I have a controller without any dml statements. How can i write test class for the controller to improve the coverage area ? public with sharing class payslipController { public Decimal ...
3
votes
1answer
103 views

Controller Class Inheritance vs Multiple Controller Extensions

From reading the docs and dev forums, it seems that having multiple controller extensions can offer the ability to override methods, and keep class size/structure simple. Because these are things ...
0
votes
1answer
43 views

Custom VisualForce Page/Controller SObject only accessable by creator

I'm having an issue with a custom Page/Controller in that, it is fully operational in production if I (the creator, I'm also a system admin) access it, but to everyone else it displays the error ...
1
vote
2answers
31 views

apex:inputCheckBox selected attribute is not working

i write a small snippet related to apex:inputCheckBox <apex:inputCheckbox onclick="callRemoteFunction(this,{!num})" selected="{!isItemSelected}"/> i am facing error Unknown function ...
0
votes
0answers
32 views

Knowledge Article System.QueryException: List has no rows for assignment to SObject [duplicate]

I'm getting the following error in a knowledge article controller that i'm working on: Article__kav article1 = new Article__kav(); article1 = [select URLName, id, Title,Partners__c,Cisco_Account__c, ...
1
vote
1answer
130 views

Visualforce: Pass inputHidden value to controller variable

I am attempting to use jQuery autocomplete to pass values to my controller. Autocomplete doesn't seem to work with apex:inputField so I am forced to use an html input. The problem is I can't seem to ...
1
vote
1answer
27 views

How to show grand child record names in Pageblock Table

I have 4 objects A,B,C,D Visual force page written on A results showing in Page block table. Relationships: A--->B Master Detail C---> Junction Object for B & D REQ: Need to show D names along ...
1
vote
1answer
44 views

Opportunity Record Type Selection Page

I'm trying to create a visualforce page which clones the record type selection page when creating new Opportunities. I'd like the page to display opp record types based on the related account record ...
5
votes
4answers
158 views

Visualforce Controller Unit Test (VF page displays fullcalendar)

I've written a visualforce page (with the help of examples etc from the internet) to simply display an instance of fullcalendar.js. There's no buttons etc, it simply loads when clicked from the home ...
1
vote
0answers
32 views

Cancel with confirm message requires double click

I have a simple example of a custom controller and a VF page. I have a cancel button on the VF page that shows a confirmation message to save unsaved data before leaving the page. When I click on ...
1
vote
1answer
50 views

Creating the child record based on parent field

Opportunity-->Pif(Child) Opportunity-->Proposal(Child) I have a logic for for single PIF can able to create many propsals. Now Requirement is I have many PIF's and each PIF(PIF_GDS__c) have each ...
1
vote
1answer
47 views

Non editable fields in the runtime, can that somehow be overcome?

I try to do my dynamic filtering on the form based on an object values, entered by a user using apex:inputField. The object stays in memory and never gets inserted to the DB. When I try to assign ...
0
votes
0answers
41 views

apex:param value not getting assignTo the controller

I have create a VF page from where i am trying to pass the value to controller. I have a picklist on which when i change the picklist value i need to send this value to controller. But the changed ...
0
votes
1answer
74 views

Use Apex Controller variable into javascript in Static Resource

I have created a vf page and added some javascript into that vf page which is using controller variable : <apex:page controller="webstore"> <script> var username = '{!username}' ...
2
votes
2answers
125 views

Passthrough Page Fails to Redirect in Service Console

I am currently having an issue with my custom passthrough page where it operates correctly but, only when it is outside the service console. So when I am in the service console, any redirect ...
1
vote
1answer
63 views

2 level Wrapper class not working in wizard

I have a custom object Package__c which has various products(Product2 object) attached to it. On first page of wizard, user can enter quantity for Packages and then proceed to next page where he can ...
16
votes
2answers
367 views

How do I start to debug my own Apex code?

Sometimes questions are posted here that would best be answered by helping the questioner learn how to do their own debugging. (Remember that proverb?) I'd like to have something to link to on this ...
1
vote
2answers
851 views

Passing a value from Visualforce Page to Controller

How to pass a value from VF page to Apex Controller? I need to have a hidden field with pre-populated value inside VF page. Apex Controller must be able to read this value. How to do that? EDIT: By ...
1
vote
1answer
32 views

Can i use the inner classes which is declared in a controller in another class? Is that a best practice?

I have few inner classes that i declared in a controller. Now came the need to use the inner classes in some another classes and methods. That means i can instantiate and use the inner class instances ...
1
vote
1answer
39 views

List out of Bounds Visualforce email Template

This is driving me a bit insane. When I do a query run with the query editor and give it an id, it returns the values I need but for some reason, I am not getting anything in my email template when I ...
0
votes
2answers
115 views

Using jQuery to access a SF Controller variable

'lo everyone. I have been trying to use jQuery to access a variable in my controller and I have just not been able to put it together. So, I created a simple example to eliminate anything extra, but ...
2
votes
1answer
120 views

Apex Controller Calling Set Method During Search

I am working through the Visualforce Developers Guide and during the section on Custom Controllers, an example performs a search stating that it also executes the setter but does not explain why. ...
2
votes
1answer
352 views

How get value apex:inputField on Apex Controller

My problem is the following : I ask the user to select a value (<apex:inputField value="{!GDT_Activity__c.Sandbox_Name__c}" id="GDTservice" style="width:50%;">), and then compare this value and ...
2
votes
1answer
207 views

Create new record in one controller and pass Id to a second controller

Still pretty 'green' when it comes to Apex and I am having a difficult time with this one issue. So, I have a Visualforce page that replaces Orders to replicate the button 'Save and Add Product' ...
0
votes
1answer
30 views

Would prefixing the word “get” or “set” for method names in controller ran automatically without invoking?

i am just getting suspicious that prefixing the word "get" or "set" before method names in controller run automatically without invoking? Experts please clarify?