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

learn more… | top users | synonyms

1
vote
1answer
22 views

Writing JSON using JSONGenerator with writeStringField()

I'm wondering why I can't use the method writeStringField() on the class variables below. I'm using the JSONGenerator class methods instead of hand-constructing the string. global class ...
1
vote
1answer
20 views

using savepoint in extension controller

I have a extension controller for my Visualforce Page. It has 2 Action methods, method1() and method2(). Each method executes DML statements. if there is failure in method2(), I need to rollback the ...
0
votes
0answers
17 views

why do we need extension for controllers [duplicate]

I am new to SalesForce , I just learn about Standard controllers ,Controllers and Extension to these controllers. But what I do not get is why we need extension to the controllers ? By that I meant, ...
1
vote
3answers
100 views

0% code coverage Test APEX class

I have set up a simple APEX class that is an extension for a Visualforce page. The VF page has a commandButton that saves and takes you to a different page called "Congratulations.vfp" I have been ...
4
votes
3answers
167 views

'Map key null not found in map' when using apex:pageBlockTable

I have a simple controller extension with has a method which returns a Map<String, Map<String, Boolean>. public class UserExtension { private final User theUser; public ...
1
vote
1answer
25 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
3answers
137 views

visualforce page on Custom Object related to standard object

I want to add a visualforce page to the page layout of a custom object. The custom object is a child of the account. The visual force page will show a list of records on 2 other custom objects. ...
1
vote
1answer
50 views

How to accept InputField to filter a query and then display results

To save you a search, similar examples exist at how to pass value from visual force page (InputField) to controller? and ...
0
votes
0answers
37 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 ...
3
votes
1answer
162 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 ...
4
votes
2answers
324 views

SObject row was retrieved via SOQL without querying the requested field in controller extension

I have written this controller extension: public with sharing class PopupController { ApexPages.Standardcontroller cont; public Request_Change_Reseller__c req{get;set;} public ...
2
votes
1answer
27 views

Can I send a user to a standard layout edit page at the end of a wizard?

I want to do something that's been asked about before, but I am going to give some more reasoning in case I'm missing a better solution. I am developing a package. As part of this package, there's a ...
0
votes
2answers
89 views

Retrieve Data from Custom Object in Datatable for a specific Account Id

I am trying to reference a custom object that has a related list on our account page called "SVMXC__Service_Contract__c" and has a child relationship name to accounts of: R00N70000001hzYIEAY. I need ...
2
votes
1answer
466 views

SObject row was retrieved via SOQL without querying the requested field?

I recieve the following error: SObject row was retrieved via SOQL without querying the requested field: Installation__c.Name Controller extension on custom object: public class ...
4
votes
1answer
113 views

Unknown property

Why am I getting the following error? Unknown property Controller Extension public class CrewWorkDetailController{ public final Installation__c installation ; public ...
0
votes
1answer
70 views

How to increase standard controller extension code coverage

I am attempting to write a test class for a very basic controller extension. I cannot seem to get 100% coverage in this method. From the 'Try' statement to the 'Else' statement has no coverage. Any ...
0
votes
1answer
82 views

Get a value just edited from controller to Visualforce page

I'm building a Visualforce page that let's the user upload some images, they can add as many images as they want, when they click on the "add new" button, a new record is inserted and one of the ...
2
votes
1answer
361 views

Inserting a parent and multiple child with the same visualforce page

I have a master detail relation ship between two objects where NdF__c is the parent, and the child is LineExpense__c. I want to insert many LineExpense__c relating to one NdF__c, so I add dynamically ...
2
votes
2answers
28 views

Obtaining the page's obect Id from a component

I have a component that reads one of the parameters on a page to get the record information for an account. The problem is that the main page has some HTML DIV sections that act like dialog boxes. ...
1
vote
1answer
191 views

How to default parent fields when displaying new child object VF page

I have created a custom lookup field on the Order object to the Opportunity because we want to create Orders from Opps and not Accounts. I have also created a Visualforce page for Orders and am ...
2
votes
2answers
297 views

Visualforce Page Unknown Constructor Error

I have a Visualforce page that is referencing a controller extension, but I am getting an Unknown Constructor error, which appears to indicate that the controller doesn't exist (but it does). I have ...
1
vote
0answers
221 views

Need to create a new custom object record (new order) based on the current page record (current order) using custom VF

I have an Order custom object which consists of order items. Once this order is delivered to a a store for a customer, I want to add a button (on the order) that allows the employee to reorder any ...
0
votes
1answer
162 views

Insert records from another object in section with visualforce

I need insert a section in object registo__c with a lists with records from another object task__c, but just all tasks aggregated to a same project that registo__c So in registo__c I have a lookup to ...
0
votes
1answer
116 views

VF ControllerExtension: Too many query rows: 50001 - How to solve

visualforce Extension: public class Autocompletefields_custom1 { public Autocompletefields_custom1(customreport controller) { } //Variable declaration transient public String[] ...
-1
votes
1answer
89 views

how to write Test class for extension or javascript remoting class

Hey i write extension for my custom controller. how to write test class for this extension, in this this extension im using just one javascript remoting method? here is my Extension Code global with ...
2
votes
1answer
91 views

Saving a new record in VF - using extension to add fields user cannot add

I have been working on this for a day too long and I do not know why I'm not getting it. It should be the simplest thing.. A user can review a thing. All I want them to do is make a rating 1-5 and ...
6
votes
1answer
634 views

How to override Save method in standard controller extension?

I am wriiting a extension on Case object. There I want to write a save method with my own logic and want this save method should override the standard Save method. So my code goes like below: ...
3
votes
1answer
380 views

Uncaught ReferenceError: initViewstateTab is not defined. Debugging Visualforce Page/Controller

I'm attempting to build a visualforce page with the following functionality: Dynamically generate 3 picklists, based on children of a given object's values. Based on the values of the picklist, pull ...
2
votes
3answers
2k views

How to bind visualforce page values to Apex controller code for use in business logic

I have been trying to do something that I thought was easy, but it is making me crazy. I can get values from the apex code to be shown on a Visualforce page, that is ok, {get; set;} will do it. Now, ...
0
votes
2answers
125 views

what's better, custom controller or extension

I need to create a visualforce page that automatically creates a case and an event about the case creation. Once a user lands on that page, which has one parameter identifying the account, if the ...
1
vote
1answer
217 views

Controller Extension Test - action method in actionSupport not invoked automatically?

Assuming I have two picklists in my VF page, something like this: <apex:selectList value="{!parentId}" id="cmbParent" size="1" required="true" label="Parent"> <apex:selectOptions ...
1
vote
1answer
375 views

Best approach to cloning records with rollback

I have the below code which works well to clone a case record. In this scenario, we want to insert a new case and save it. But I have a new request to create sort of a quick case where we would only ...
4
votes
1answer
774 views

Can you access parent object fields in a 'New' page override without using SOQL?

I have two objects, Parent__c and Child__c, Child__c has a lookup field to Parent__c calledParentId__c. I have overridden the New and Edit pages for Child__c using a Visualforce page with the ...
3
votes
1answer
75 views

Can't create apex page which uses controller extension via apex-mdapi

I have a class in my managed package: global class myExtensionClass - which is extenison controller. I installed this package in test salesforce developer account. When user click one of the button ...
1
vote
1answer
31 views

Controller extension on an archived task

So I have a VF page that is being used to override the Task View and Edit actions. <apex:page standardController="Task" docType="html-5.0" readOnly="true" extensions="myControllerExt"> ...
-1
votes
2answers
146 views

Need help with extension test class

I need some major help writing a test class for my extension. I've work half the day with no luck. There's no use in posting what I've got as it isn't working. This is my first extension class. Any ...
2
votes
1answer
161 views

How to limit Visualforce lookup field to only lookup and show Users instead of other objects?

So I have a VF page looking into a custom setting field - SetupOwner. The issue I'm having is I want to display only users and have end user only edit/add users to the custom settings as opposed to ...
2
votes
2answers
140 views

Displaying Errors Through actionFunction

I have an APEX Page with a controller extension that collects a few fields of information from a user and creates a lead with a task when they click on the "Create Lead" button. I have purposely made ...
3
votes
1answer
61 views

How can I submit a Detail-tag based page?

I have a very simple VF page that displays the Detail-tag Opportunity page. Within it, I have a Custom Button that calls the finish() JS method. From there, I would like to submit the Opportunity ...
0
votes
1answer
23 views

can any body figure this error?

In case data is not there it has to empty CEO .in case the data is there it has to show that data Controller: public with sharing class silogletter { public Contact contact {get;set;} public ...
0
votes
1answer
615 views

System.NullPointerException: Attempt to de-reference a null object

Can anyone help with this error? System.NullPointerException: Attempt to de-reference a null object Class.productdata.getMapOfContent: line 24, column 1 Here is the Apex Class. "Line 24" ...
2
votes
1answer
946 views

Update Record values on Visualforce Extension by actionSupport

Background I have a VF page that use StandardController="Opportunity" and also extensions="OpportunityControllerExt". I'm showing the opp.stageName and the opp.Probability. When the StageName ...
3
votes
2answers
258 views

How to test New behavior of a custom controller extension

I have a Parent__c and Child__c object with Child records using a custom Controller Extension and Visualforce page for EDIT and NEW. Testing this controller extension for existing Child__c records is ...
1
vote
2answers
248 views

Modify visualforce input before saving and before reaccessing

Here's the scenario. (a) In standard controller extension for Custom_Object__c, we define custObj as public Custom_Object__c custObj{get;set;} (b) In visualforce we have an input field ...
5
votes
1answer
545 views

Unable to access controller class properties from extension class

I am creating a new opportunity wizard to ensure that specific data is always entered when our sales reps create a new opportunity. As part of this effort, I've also over-written the lookup window for ...
1
vote
0answers
27 views

How can we associate this process to one record? (Record Id in Controller, Prepopulate Field A and prompt user input for Field B.)

Really looking for some help/insights here..Any guidance would be greatly appreciated!! Here's my scenario: A record id can be obtained in the controller using ...
0
votes
1answer
2k views

Creating New record using Standard Controller and Extension

I have created a page using standard controller and extension. This page should create a record if no id passed and shuold update a record when id passed. Following is the controller public ...
1
vote
0answers
82 views

How can I make it so that everytime constructor is going to get called?

I have a page A contains another page B by apex:include. however when every I tried to refresh the page using rerender the constructor won't get called. page b has a standard controller and extensions ...
2
votes
2answers
632 views

How to pass page message to arbitrary Page Reference [duplicate]

Is it possible to pass a page message to a newly created PageReference, so that this page will display it? public PageReference doAction() { PageReference resultPage = new PageReference('/'+id); ...
3
votes
2answers
286 views

Editing a Account picklist field on an Opportunity page layout using VF page

I need to create a VF page that I can insert on my Opportunity Detail page layout that will contain custom fields for the Account object. This will allow our sales reps to edit/update these fields ...