A custom controller is an Apex class that uses the default, no-argument constructor for the outer, top-level class. You cannot create a custom controller constructor that includes parameters.

learn more… | top users | synonyms

3
votes
3answers
184 views

Please explain how apex controller works

I don't understand why the following controller updates an account. My thoughts that there should be public void setAccount() {...} method so changes in view will be available in controller. Custom ...
1
vote
1answer
26 views

Custom controller, default object values, and validation. How can I get all three to work in harmony?

I have a Visualforce page that is backed by a custom controller. The custom controller has a public property of type Event (called ThisEvent) that the Visualforce page uses to bind to several input ...
3
votes
2answers
29 views

Why are my validation messages not displaying on my Visualforce page?

I have a Visualforce page with a custom controller. Whenever there is a validation error on saving, the user is shown a white page with the text SObject row does not allow errors: I have followed ...
1
vote
2answers
38 views

How to Create a Date Input Field

How can I create an apex input with data type date? I tried using showDatePicker but it has an error: value for <apex:inputField> is not a dynamic binding.
3
votes
2answers
72 views

Why are you forced to have an empty method to use a method with input parameters? [duplicate]

I'm calling an apex controller class method from my visual force page using an actionFunction like so: <apex:form > <apex:actionFunction name="FunctionName" ...
2
votes
1answer
15 views

Implementing CompareTo In An Inner Class That Needs Outer Class Data

I'm using Apex and VisualForce to make an "open house event check-in page" for a department. For various reasons pertaining to AppExchange plugin compatibility, we are storing a separate "Event" ...
1
vote
2answers
61 views

Making VF page list items (custom object & controller), go to detail page, add 'return' button?

I am creating a page to be placed on my customer community site that will show contractual employees their past/present/future events on a list. My goal is to be able to click those list items and ...
1
vote
2answers
57 views

Reference a child field in grid or create grid from standard controller

Is it possible to reference a child field in a grid when using a standard controller from an object? Or do I have to create a custom controller? If I do have to create a custom controller then do I ...
0
votes
1answer
37 views

Solution to optimize code that exceeds limits of 50k rows returned

I would need guidance over how to avoid getting de 50k limit rows on one visualforce page that monitors the transactions that are going to be made on the present day + 2 next days, shows a lot of ...
0
votes
1answer
35 views

Test Code Coverage on VFP with SOQL query

Have a custom object that we are using to document our refreshes to our sandboxes. We are attempting to put this data onto a VFP so we can expose to non-licensed Salesforce workers using a Force.com ...
1
vote
0answers
55 views

Dynamic Search Page using wildcards

I have a requirement to be able to search in the Case standard object in fields such as Subject (text 255) and Description (long text area 32000) using wildcards. I found Jeff Douglas ...
0
votes
1answer
50 views

Test class for custom controller [ pass the public string from vf to controller ]

i am neophyte to test class. here's my issue. i use custom controller and i use public string to get the all value from my vf. how do i pass all the value on my test class ? --Apex Class-- public ...
0
votes
2answers
33 views

Compile Error: Initial term of field expression must be a concrete SObject

I have a custom controller extension below which pre-populates the Opportunity ID and a Contact Role ID to a Visualforce page for a custom object that has a Master-Detail relationship to the ...
0
votes
1answer
30 views

Pre-populate Formula Fields to Visualforce Page

I have a custom object with a Mast-Detail relationship to the Opportunity. I am trying to create a Visualforce page that will pre-populate fields based upon values in the Opportunity and Account. I ...
3
votes
1answer
122 views

Why do I get a String to System.SelectOption conversion error?

I'm getting the following error when I click on the commandbutton in my Visualforce page: EXCEPTION_THROWN [EXTERNAL]|System.TypeException: Invalid conversion from runtime type String to ...
7
votes
1answer
191 views

Visualforce components within components

Fairly new to creating Visualforce components and I'm attempting to reuse some of my front-end mark up with multiple components that used in a parent component. At first I question if this was ...
3
votes
3answers
84 views

Standard Controller OR Custom Controller

When and how to decide whether to go with Standard Controller OR Custom Controller? I have created so many vf pages,classes, extensions but still I'm not sure to include standard controller or custom ...
0
votes
2answers
55 views

getting input data from VF page to controller

I am trying to get a date value in a VF page and transfering it to a custom controller using a custom object reference Ticket__c. This says i am trying to deference a null object. How can i get the ...
0
votes
1answer
74 views

Accessing custom object fields on visualforce page from custom controller

I am writing a custom controller and a visualforce page to take the input data from vf page and process the logic in controller. Here in vf page I am trying to pass two data values of different ...
0
votes
2answers
39 views

How to add new fields to a VF page when they are not included in the custom controller used for the page

I have a custom controller and VF page which allow my users to create and save a contract by using several information fields on the opportunity and related account page. Since this was first created, ...
0
votes
1answer
43 views

Opportunity Contact Roles in VF Controller

I have a custom Visualforce controller that applies to a custom object (SF__c). This object has a master-detail to the Opportunity object. My controller pre-populates the SF__c object with the ...
0
votes
1answer
364 views

Override Standard New Button with Visualforce Page

I have a custom object that has a Master-Detail relationship to the Opportunity object. I created a Visualforce page that I want to use to override the standard "New" list button on the related list ...
0
votes
1answer
21 views

displaying information from 2 different tables

So i just started out learning visualforce and i am stuck. I am trying to create a table that contains information from 2 different objects. One object is Account and another is contact. So far the ...
0
votes
1answer
54 views

Test Class - Controller/Component For Data List Only

I've been struggling for a few days now on this and just cannot find the answer. What I have is a controller that simply passes a list through based on two criteria. The controller is used by a ...
0
votes
0answers
62 views

Including child object's attachment in VF email template

Scenario- Case has a child object (a custom object - sample_case_child__c) which may have some file attachments on it. Goal - when a case is sent for approval, the email sent must include some ...
0
votes
2answers
62 views

Pagination methods aren't working

After a great deal of searching and effort, I've finally got a working controller that can show ContentVersion documents and paginate them. Upon testing it, though, I found that the Next button ...
0
votes
1answer
37 views

Custom controller to call one specific record from a custom object

I created a custom object named 'Live_Chat_Switch__c' with one custom field 'Enable_chat__c' (boolean) and I would like to call that field of a specific record on a VF page. To do so, I created a ...
0
votes
0answers
100 views

write a test class that gets a Flow.Interview

I have created a Flow that creates a "quick case". I have a VisualForce page that has a "Quick_Case" apex class as a controller that gets the Flow and returns the landing page once the case is ...
1
vote
4answers
828 views

TrailHead - Creating and Using Customer Controllers “bounding”

Here is the criteria for the question: • The page must be named 'NewCaseList'. • The custom controller Apex class must be named 'NewCaseListController'. • The 'NewCaseListController' Apex class ...
1
vote
1answer
86 views

Create Visualforce Page with dependent multi-select picklist

I am new to Salesforce and trying to make a new VF page. I have three custom objects: Students (list of students) Course Details (course time, start date, room, etc.) Student Course Detail Junction ...
0
votes
0answers
55 views

Salesforce Controller Test: getAccounts method not filtering by profile

I have a custom controller that is intended to return a results set to a visualforce page for customized viewing. It works fine in production. When building my unit test for this controller, ...
0
votes
2answers
44 views

How overriding works in standard/custom controllers?

1) If I have a standard controller and two extensions Ext1 and Ext2 and if both Ext1 and Ext2 have the save method, then whose save method will be called Standard controller's, Ext1's or Ext2's? ...
0
votes
1answer
58 views

CommandButton to Increase/Decrease Probability ln Visualforce

I have a Visualforce page that has a list of opportunities with their probabilities. I want to use commandbuttons to allow the user to increase or decrease the probability by 10% right in the list ...
2
votes
1answer
235 views

Visualforce component on page - not rerendering after onclick event

I'm attempting to rerender an apex:outputPanel containing a visualforce component. When I click the panel containing the onclick code to call the controller method to change values and rerender, ...
1
vote
0answers
147 views

Custom Collapse/expand functionality in visualforce page [closed]

Can any one help me how to implement custom collapse/expand functionalities in visualforce page.(Using vf components, html,javascript) I have requirement to implement the above functionalities same ...
1
vote
3answers
919 views

Passing URL parameters from VF page to custom controller

How can I take a URL parameter and pass it to a custom controller method? For example, I have a button from a case that goes to VF page with its ID in the url. (ex - ...
1
vote
1answer
21 views

How to generate Helper class runtime

Is there a possibility or did anyone tried to generate an Apex helper class based off certain conditions runtime. I am thinking this just for LEARNING prospective. This will also reduce the number of ...
1
vote
1answer
337 views

Illegal assignment from Schema.SObjectField - apex code [duplicate]

Do I have to load that in List only ? I'm coming from .Net background and still learning how does the SF works... PS: Schedule__c is a custom object and trying to access the field from. Error: ...
0
votes
0answers
46 views

Custom Controller for Dashboard Use

I have a page which shows tables of Users' activities (below is truncated view of it. B/c it uses a standard controller it can't be displayed as a Dashboard. How would one go about getting around this ...
3
votes
1answer
69 views

Duplicate Value Found: <unknown> Duplicates Value on Record With Id: <unknown>

I am getting this problem while saving the following controller class class public class NewAndExistingController { public Account account { get; private set; } public ...
2
votes
3answers
270 views

Apex:CommandButton sending data to controller

I'm trying to create a visual force page with a table and a "request" button that will take the selected row and append it as a task. Here's a photo of the table: When a user hits request, I want ...
10
votes
5answers
7k views

Apex Controllers: What do the get; set; do?

I've built a few apex controllers, and like most people have copied some code from here and there. In the controllers, there's typically an expression that looks like the following: public *var type* ...
1
vote
2answers
358 views

Re-rendering content within Custom Component from Visualforce Page

Is it possible to re-render the content within a Custom Component from the parent Visualforce Page? I have a custom component in an apex:outputpanel like so: <apex:outputPanel id="popup"> ...
1
vote
0answers
123 views

Leverage StandardSetController pagination in Edit grid

There are numerous examples out there how to use StandardSetController to display Table grids for many SObject records. It's internal pagination mechanism is very helpful to e.g. reduce Viewstate on a ...
0
votes
0answers
35 views

Can rendering of a big Pageblocktable lead to CPU timeout errors?

In my page after clicking a custom save button I am rerendering a huge apex:pageBlockTable with 150+ rows, 20 columns. <apex:repeat value="{!fields}" var="field"> ...
0
votes
0answers
41 views

What is an Ancestor Method?

I have a leadConvertController that is tied to several components and other controllers. One line keeps giving me a Method does not override an ancestor method. I don't even know where to start to fix ...
2
votes
2answers
575 views

Not able to save using simple custom controller

I'm learning custom controllers and facing difficulty in simple save action in Account page. What I'm doing because of changes made to account are not getting saved ? This is my simple VF page ...
0
votes
1answer
149 views

Visualforce Error :Attempt to de-reference a null object

Can any one help me out with this Error .I'm getting Visual force Error :Attempt to de-reference a null object . To identify the same product name in a table in a visual force page which is in a ...
0
votes
1answer
117 views

Test to Cover Custom Controller

I'm having trouble getting adequate test coverage for a custom VF controller I created. My test and controller are below. When I run the test, I am getting no coverage for lines 13, 16-17, and ...
-1
votes
1answer
149 views

Assign Value to record from button click

I have two buttons: <apex:form > <apex:commandButton styleclass="btn-lg btn-data" value="Vote Up" action="saveUP"/> <apex:commandButton styleclass="btn-lg btn-data" value="Vote Down" ...