A controller extension is an Apex class that extends the functionality of a standard or custom controller.

learn more… | top users | synonyms

0
votes
1answer
18 views

Assistance with test class for VF controller extension

I have a controller extension for a visual force page that currently has 0% coverage. A test was never written for it and I'm quite a novice when it comes to programming but I've got to start ...
1
vote
0answers
24 views

Visualforce: Selected InputCheckbox value not updating

I have a deep custom wrapper object that is made up of other wrapper objects. Essentially I have Ledger which contains a List<Entry> which contains a List<LineItem>. These all are iterated ...
0
votes
0answers
64 views

Visual Force - Wrapper Class integration

I am having issues integrating a wrapper class generated in one controller/VF Page into another Visualforce Page displayed. With an action, the selected accounts generated by one VF Page would be ...
0
votes
2answers
11 views

Command button action using controller method

I have a command button where the action is a controller method. I am getting a visual force error Formula Expression is required on the action attributes. I did some looking up and this requires ...
2
votes
2answers
100 views

JavaScript remoting in Visualforce

I need to remotely call an apex method in a Visualforce controller, but the JavaScript code is not working. Controller method: global with sharing class MemberPoliciesController { @remoteAction ...
3
votes
2answers
43 views

System.NullPointerException: Attempt to reference a null object

Here I have 3 VF Pages (ProjectCreate1, ProjectCreate2, ProjectCreate3) and i'm using an extension (ProjectCreationextension) for Standard Controller. The Error is at line 70, saying that the ...
2
votes
2answers
95 views

Launching Flow using VF page

I'm attempting to run a flow from my first VF page. I was able to construct my code using the concepts I learned in another StackExchange post. I can get the flow to run just fine using the VF page ...
5
votes
1answer
57 views

SObject row was retrieved via SOQL without querying the requested field. Transaction_Survey__c.Transaction_Score_Other_Reason__c

I'm getting this error in a Visualforce page I'm working on. I understand that this error comes up when you try to reference a field you haven't queried, but the problem is, I have it referenced on ...
1
vote
1answer
78 views

Help displaying aggregate results in footer of pageblock table

I am trying to create a Visualforce page to display a list of related records (lookup relationship) in a PageBlockTable. I would like to include a footer row that displays the sum of one of the ...
1
vote
1answer
27 views

How to save updates to a related record on a visualforce page

I have a visual force page that dynamically displays records attached to a case. When edited I need these to be updated when a user presses save. Right now it is not saving. Visualforce page: ...
5
votes
2answers
122 views

Test ControllerExt for Flow

I am trying to get coverage up for the following controller extension which I am using with Flow public class ClosedLoopMarketingFlowExtension { private final Contact cont; private ...
0
votes
1answer
25 views

How to save edits on a custom visual force page on a related object

I have a visual force page where the standard controller is the Case object and it has a related object. I need to save edits made to the related object, but there doesn't seem to be a straight ...
0
votes
1answer
83 views

How to iterate over a list of objects in visualforce

I have a controller extension with the method GetAttributes that returns a list of Attribute objects, how can I iterate over them with apex:repeat? Controller Method: public ...
1
vote
1answer
157 views

Update VisualForce Page field after Apex future callout

Want to update a VisualForce Page once my @future Apex Callout is done. How can I update a VisualForcePage, once the Webservice callout is done? Could I somehow divide the SearchCRM method, so that it ...
5
votes
2answers
49 views

Multiple Extension problem

I am working on Visualforce page which using standardController and has multiple extension. <ape:page StandardController = 'CustomObject__c' extension = 'ClassA,ClassB'> ...
0
votes
0answers
23 views

VisualForce page(URL with parameters), using parameters to search Salesforce and show contact

I have a VisualForce page, where I want to show a contact, with some customized buttons. The VisualForcePage will recieve three URL Parameters: lastName, firstName, customerNumber. Based on these ...
1
vote
1answer
38 views

How to display this data with VisualForce?

Let's say I have an object 'Vegetables'. It has 3 fields. Name, Amount, Month. So for each Month we have a record of the amount of each type of vegetable sold. How would I go about displaying this ...
1
vote
1answer
82 views

Visualforce page usingbase standard controller

I have the following Visualforce page and controller: <apex:page standardController="sObject" extensions="ExtensionController"> <div> {!o.Id} </div> ...
2
votes
1answer
94 views

Show DML exception in VF page

Summary of what i am doing - I have a standard Object - ServiceContract, its child (detail) standard object ContractLineItem, and a custom object (Transaction_Line_Item__c) which is a detail to ...
1
vote
2answers
68 views

How to redirect to a VF page with a VF button

I have a mySObject__c and a page mySObject_Button_Page with <apex:page standardController="mySObject__c" extensions="mySObject_Button_Extension" title="{!mySObject__c.Name}" ...
2
votes
1answer
112 views

Help with extension to pass parameters to pre-populate fields on new custom object record vf page

I have a Visualforce page for creating a new record (custom object) from account. I also have a controller extension to pass the URL parameters and other values to pre-populate values on the vf page. ...
2
votes
2answers
187 views

Visualforce still sees the old controller variable value even after update

I have a simple controller and VisualForce page as written below: SampleCon.cls public with sharing class SampleCon { public Boolean buttonOneClicked {get; set;} public Boolean ...
1
vote
3answers
123 views

Visualforce page to edit Contact details not working

This Visualforce page is setup to edit some fields from the users Contact record but it is not saving any changes and throwing error Required Field Missing [Last Name] <apex:page ...
3
votes
1answer
82 views

4 level, nested for-loop. Bulkified?

I have the following code that works for me. My main concern is the nested for-loops I have toward the end of the code. I'm in the sandbox and don't have enough records to bulk test. I figured I'd ...
1
vote
1answer
245 views

How can I use pagination in a VF page when using a Controller Extension?

I have a Visualforce page with the following attributes <apex:page standardController="Asset" extensions="myAssetsExtension" sidebar="false" showHeader="false" standardStylesheets="false"> I ...
4
votes
0answers
54 views

Can't access Flow.Interview Class within Apex Controller

I am trying to override a Salesforce standard button on the case page layout (Clone As Child Button) - which will create a related child case with some of the fields from the parent copied over. ...
3
votes
2answers
287 views

Saving Opportunity and related Contact from single Visualforce page

I have created a visualforce page that displays both opportunity and contact fields that I want users to be able to edit and save. I am using the opporutnity standard controller and added the ...
3
votes
1answer
181 views

Unable to set controller extensions property with component attribute

I tried setting "accType" property in this extension class with "Customer - Direct". But it is not getting set or getting set as NULL. My VF Page <apex:page standardcontroller="Account" ...
0
votes
1answer
43 views

Visualforce page sharing same extension instance

From here I understand that it is possible to add multiple pages to a single extension but I want to take it further and not generate a new extension instance when the other page is loaded but keep ...
-1
votes
2answers
30 views

Issue with Extension Code Coverage

I have an Extension that works perfectly but the Test Class only has 65% code coverage. I cannot figure out why I don't have 100% (or at least 75%). Any help is greatly appreciated! Extension Class ...
17
votes
0answers
223 views

How to write the superduper (=proper and stable) Custom Save method

Custom Save actions in Apex are tricky! Here are my requirements which I was unable to fulfill without harming the stability of my code: Save for New and Edit (works with record with and without ...
1
vote
3answers
26 views

Visual force + Extension = Can't display values?

Working on a PDF report using Visualforce. Earlier questions answered here (LINK) but now I'm stuck again. I have two child objects off of Account. Issue (Issue__c) Filing (Filing__c) The ...
0
votes
1answer
37 views

Controller Extension help

First, I don't have anything to post as far as code, because nothing has worked even remotely so far. I've written several extensions that allow me to 'look down' to child data (for instance, all the ...
1
vote
0answers
30 views

Attachment Parentid population

I have two VF Pages. Say V1 , V2 where V1 is my parent page and V2 is included in it. Here in V1 an instance of a custom object (Call) is created and in DML insert it gets into the system. In V2 ...
0
votes
1answer
87 views

Create new records using Visualforce action and AggregateResult

I have a need to aggregate values from child records, group them by an Id field on that record and then create a new record for each corresponding ID. I have 2 objects, Sesaco_Contract__c and ...
0
votes
2answers
265 views

Passing a Visualforce InputField to a Controller Extension

Sorry for the newbie question ... I'm just starting out and I have a simple issue that I'm hoping someone will be able to help me with. I'm not able to pass a value from an inputField on a VF page to ...
1
vote
2answers
42 views

Which custom save() is better?

Sometimes in code examples of custom save methods (of controller extensions) you see the use of try/catch and an explicit translation of Exception to PageMessage. Explicit Error Handling: public ...
1
vote
3answers
58 views

Custom Save on New/Edit page - Is this valid code?

In my controller extension I have a custom save method that works for New and Edit scenarios also saves modified child records The below code works in all unit tests but starts to show strange ...
0
votes
0answers
95 views

Testing controller extensions with a feildset for by custom object

From past few days i'm working on writing an Apex test for my controller extension. I've created a dummy record for my custom object then passing the id in the constructor while invoking my extension. ...
4
votes
1answer
232 views

How to instantiate a class in custom controller from within controller extension?

This should be simple. I have a custom controller like so public class MyClass { . . . public class MyType{ String a; Integer b; List<Account> c; } ...
3
votes
0answers
74 views

How to test controller extension for 'New' record use case?

I'm trying to create a test class for a null record. I have a vf page, and extension, that acts as a form for creating a new record. In my extension constructor I have the following code public ...
0
votes
1answer
87 views

Trying to make Apex Test Class for VF page extension class but keep getting errors

Trying to save this Apex Test Class keep getting error Error: Compile Error: Constructor not defined: [GoogleMap_Meeting_Controller].() at line 35 column 51 Here is the VF page extension: ...
1
vote
3answers
83 views

Test Class Issue - My REST Method Isn't Getting Run

In my visualforce page I have a search field (inputText) with an id of 'query'. Query is passed into my controller and the runSearch() method starts a process which initiates a web service call. In my ...
0
votes
0answers
23 views

Overwriting Save&New button on edit page with controller extension

I need to extend the functionality of my save&new button by passing the current recordType of the record to be saved to the new record. Am I able to do this somehow with a controller extension, or ...
1
vote
0answers
51 views

Accessing Case.ContactId from Case StandardController (for Controller Extension) on [New]

I'm building Custom Console Component pages to display with Case detail in Service Console to display other recent cases, assets, related Contact/Account details, etc. leveraging the Case.Id that is ...
0
votes
1answer
141 views

Is it possible to call a PageReference method from inside the controller (w/o user interaction)?

I'm wondering if it's possible to call a PageReference method in a controller without the user having to click on any vf page buttons. For example, I have the following condition...(see below)...and I ...
0
votes
2answers
400 views

Pass inputField value to controller before a record is created/ saved

I'm trying to get the value of an apex:inputField on my vf page before the a record is saved/inserted. Here's my scenario. The user is presented with a blank form (all input fields on the vf page ...
1
vote
1answer
133 views

Referring to a controller extension in VF remoting

I’ve created a class to extend a standard page controller… (documentation) <apex:page standardController="location__C" extensions="locationExtension"> The class locationExtension contains… ...
0
votes
0answers
56 views

Custom button extension: field update on click

I am trying to create two buttons that inserts Up and Down on a record by clicking a command button. Here is my code so far: VF Page: <apex:form id="votingSection"> ...
-1
votes
1answer
88 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" ...