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
12 views

“Data not available” when using Database.rollback() in custom save action

In my custom edit page for LineItem__c records I have overriden the save button with my own implementation which does not only save the record itself but also change to child records. <apex:page ...
2
votes
1answer
52 views

Test Class for Visualforce page

I have a visual page controller with save() function. Inside the save() function, there is an insert object. However, when I write my test class, I am unable to query the inserted object. ...
0
votes
1answer
20 views

Why isn't this dynamic VisualForce page style toggling the Static Resources properly?

I'm currently looking at the Dynamic References to Static Resources Using Mostly, it works as expected, with one anomaly: When the page initially displays, as expected, it correctly uses both the ...
0
votes
1answer
18 views

How can I write a unit test which includes ApexPages.StandardController methods?

Currently looking at the Using Dynamic References with Custom Objects and Packages tutorial. For reasons I won't speculate on, step 7 included the controller extension code (again) instead of the ...
3
votes
1answer
53 views

How can I test create an instance of a VisualForce Controller Extension for testing?

Typical of custom controller extensions, my extension has a signature public MyVFCtrlExt (ApexPages.StandardController standardController) I'm currently trying to figure out how to write unit tests ...
0
votes
1answer
22 views

How to mass update parent from child list view

I need help with a controller extension to retrieve and update parent records from a list view. We have a child object called Patient_Session__c that has a lookup to parent called Patient_c and want ...
0
votes
1answer
38 views

can we use single controller in two VF pages?

Here is a scenario where i have a search page for users to select and display the search results. I also have a button to generate the pdf. I have a list of account in the controller which displays ...
3
votes
2answers
36 views

How do I prevent the creation of multiple Records with an overwritten save button?

I have a custom save method, which saves my object and redirects me to his parent. This works fine for me and I used this kind of approach very often. Visualforce Page: <apex:commandButton ...
1
vote
1answer
42 views

Test class for VF form can't refer to input: 'variable does not exist'

I am very new to the model-view-controller and have barely been able to get my code functional, but now I'm struggling even more trying to write test code! This is my first wrapper class, controller ...
3
votes
0answers
37 views

Internal Server Error in Partner communities when using extension controller

We have a appexchange app in which there is a global class. We are using this global class as controller in local VF page and also created a extension class. When i try to use the variable declared ...
1
vote
0answers
32 views

Unable to create an instance of extension {CLASS NAME}

I'm getting this error, i'm sure I what this means. I couldn't find anything helpful anywhere.
1
vote
1answer
30 views

Checking if object exists on controller

I'm trying to handle the edge case where a user hits my page without the Id being set for whatever reason. However, I'm having problems detecting when no object is loaded. I tried this: private ...
0
votes
1answer
28 views

Writing a Test Class for an Extension

How would I write a test class for this extension? public class PictureofSuccess{ public Account ac {get;set;} public List <Picture_of_Success__c> pictures {get;set;} public Boolean noImage ...
1
vote
2answers
129 views

Using PageReference to redirect after new record insert

Continuing from my previous post. I want to redirect the user to a custom vf detail page when they create a new Service Order from my custom page order page (force_NewOrder). I have created a ...
1
vote
2answers
25 views

Expression cannot be assigned at line

How could I assign a value to a dynamic query field? I want to make an update of a record. ac.get(campo) = totalAcumulado.get((String)ac.Name); <-- Expression cannot be assigned at line This ...
1
vote
2answers
240 views

Conditional parameter to change visualforce page and controller SQL

I have a very simple visualforce page and linking controller that will fetch records from a custom object. In this custom object there is a category field which I would like to filter against in the ...
1
vote
2answers
213 views

Error in VisualForce Page as :List index out of bounds: 0

Can any one help me out with this Error ??Any help is much appreciated Error in VisualForce Page as :List index out of bounds: 0 Here is my VF Page and the Class. Visual Force Page : ...
0
votes
1answer
103 views

Display message on parent window after closing VF Popup

At the moment I have a button placed on my Opportunities page which opens a popup, on my sendRequest() function this popup is closed. What I would like to do is further improve this function to also ...
1
vote
1answer
161 views

Get current logged in users data in VF page and extension

I want to display the currently logged in users in my VF page. Calling the following is not allowed: <apex:outputField label="Raised by" value="{!$User.Id}"/> I would like to know how else I ...
3
votes
1answer
81 views

custom controller with extension

What are some use cases in having a custom controller with extensions? Does it make sense to have something like this? EDIT2 Edited out the error I was receiving - apparently in my extension I was ...
1
vote
1answer
70 views

Visualforce page for question with custom object.list the all question in the page

I have custom object called offering_details__C which lookup to question . visualforce page for question with saved in the custom object and list all the question in the same page . Below is the ...
0
votes
1answer
34 views

Visualforce tab to track order details

To capture all the order details I built a VF page with an extension to get all the orders details for the current user. Following is the way I tried... public with sharing class Order_Extention{ ...
1
vote
1answer
93 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
28 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
18 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
257 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
635 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
48 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
772 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
101 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
62 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
485 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
1k 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
29 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
212 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
2k 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
126 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
181 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
115 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
2answers
733 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
29 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
458 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
600 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
413 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
314 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
248 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
248 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
148 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 ...
7
votes
1answer
1k 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
589 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 ...