Questions tagged [controller-extension]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
1k views

getParameters().get('custompara') Not Getting URL parameter

The below controller is attempting to grab an custom object id from the URL. The logs show that it fails to assign the string var para the id value from the URL. The system.debug for var para returns ...
1
vote
1answer
91 views

HTML form isn't sending values to apex controller

I'm trying to create a vf page that creates records based on the records that are selected in the list view. So I created an extension that uses the standard set controller and am using html tags in ...
1
vote
1answer
553 views

Extension/Constructor on a Component

I have a Component inside of a Visualforce Page. I am not sure if this line of connection is causing a break but my issue is with my constructor. It is not taking in the params I am passing: Page: &...
1
vote
1answer
159 views

Need clarification on a getter

I have a custom visualforce page and controller extension that is working. There is one getter that I do not understand why it works. I was hoping someone could explain it to me. In the below code I ...
1
vote
2answers
31 views

Extension controller unable to pass values to third controller

For some reason I'm unable to pass Task Id and subject to another controller from this extension controller. Any help? public with sharing class MyExtensionController { private final Task t; ...
1
vote
1answer
77 views

Rerender Error, with controller extension

I am receiving an error when trying to rerender a covenant table: Unknown property 'Loan_Memo__cStandardController.covenanttable' How to I load my table based on the value of the inputField? VF: ...
1
vote
2answers
1k views

Content cannot be displayed: Attempt to de-reference a null object. Controller and Visualforce Issue

This basic controller below should work. I get the Content cannot be displayed: Attempt to de-reference a null object. Controller and Visualforce Issue error on the Visualforce page. Looks like my ...
1
vote
1answer
119 views

Test Class for Visualforce Extension

I have a custom controller on a custom object and I am trying to write a test class. However, when I try to save the test class, I get the error: Compile Error: Method does not exist or incorrect ...
1
vote
3answers
252 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 ...
1
vote
1answer
84 views

Test Class Guidance (What, not How)

I have the following extension class that I'm using to build a visual force page. It is intended to display a filtered list of Campaign History, rather than the existing related list. It works. ...
1
vote
3answers
579 views

Detail of Page A Repeating on VF Page w/ Custom Object A Sibling Object Records B on Visualforce Page

I have a custom object "Success__c" that I am attempting to create a visualforce page for. I would like to have the parent (MD relationship via account__c) Account fields on the page, as well as the ...
1
vote
2answers
1k views

can we use single controller in two VF pages?

I have a scenario where I have a search page for users to select and display search results. I also have a button to generate a pdf from these results. I have a list of account in the controller ...
1
vote
1answer
2k 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 ...
1
vote
1answer
74 views

Error when I try to create OrderItem records Insert failed. INVALID_CROSS_REFERENCE_KEY

I'm trying to create a visualforce page where a user can create multiple OrderItem records at the same time. The error that I get is OrderItem records Insert failed. First exception on row 0; ...
1
vote
1answer
285 views

Updating Custom Object using Visualforce

I am trying to update fields on a custom object using visualforce. I have embedded a visualforce page on Lead Layout that displays records of my custom object linked to the lead. I want to update ...
1
vote
1answer
396 views

VF Page column sorting method loses functionality when extending standard controller, why?

So I am trying to make a VF Page to display list of account records. We must have pagination and filtering from standard controller. Also we must use custom controller to create methods to alternate ...
1
vote
2answers
62 views

Setter value not arriving in apex class

I have a list that contains a collection of wrapper class instances called tacList. The wrapper class effectively contains a checkbox which relates to a case field and a string. The string is not ...
1
vote
1answer
252 views

Custom Button - RetURL Working in Chrome but not IE

I have a custom button on a record page that initiates a Visual Workflow, sets a couple parameter values, defines the finishlocation for the flow to end on a Visualforce page. For whatever reason, ...
1
vote
1answer
68 views

Unable to populate dropdown using Extension Controller

Here is my code, please help me what am I doing wrong VisualForce page: <apex:page standardController="Contact" recordSetVar="Contacts" extensions="myContactExtension"> <apex:form > ...
1
vote
1answer
166 views

Pass opportunity's stage value when stage value is edited

I have a VF page that uses <apex:repeat> to show a List<Attachment>, and I want the list to return different attachments based on {!opportunity.stageName} . VF Page code : <apex:page ...
1
vote
1answer
220 views

List has no rows for assignment to SObject - Controller Extension

I've spent several hours today trying to figure this out and running through several online resources here and SFDC forums to no avail. I keep getting the following error: List has no rows for ...
1
vote
1answer
1k views

Popup window from pageReference

I'm trying to open popup window but I can't. pagereference ps=new pagereference('/apex/Popupnewpage'); return ps;
1
vote
2answers
71 views

Look up id value to pass to controller on save of new record via standard controller

Can anyone help me with the test class for below controller. I am trying to get the values of the vf page on save of a new record. standard controller will be null at that point but i need to access ...
1
vote
4answers
8k views

Is there a way to call javascript after action on visualforce page

I have an embedded visualforce page which calls a controller method on load. <apex:page name="calloutPage" standardController="Case" extensions="WsCallout" action="{!getSomething}" ...
1
vote
1answer
330 views

Update Case field after updating value in embedded visualforce

I have an inline visualforce page on Case layout. When the case page is loaded, this loads the vf page and there is an action call on the inline vf. <apex:page name="xyz" standardController="Case" ...
1
vote
1answer
108 views

Pass InputField into Controller Extension, mass edit of Owner

Trying to make an Accounts List View with a button. Selected accounts go to my visual force page, where the user selects to Account Owner (via search field) they want those records/accounts to be ...
1
vote
1answer
28 views

Visual Force Page Extension Test Class

I have the below controller written and I have never had to write a test class for one of these so I am not sure how to go about it. Any thoughts? public with sharing class sortController { Public ...
1
vote
1answer
280 views

Make VF Page Commandlink target variable

I have a VF link on a page which creates a new record. It's embedded on a page layout. My problem is that I would like errors to show in the embedded section without redirecting, but if it's ...
1
vote
1answer
1k views

Get the value of drop down list that was selected earlier

In my piece of code below, I use select list tag to get user's input for a field of an object. I have a text field type for an object which I am trying to update using a VF page. <...
1
vote
1answer
539 views

Multiple Extenstion with common method name

While using a multiple extension <apex:page controller="ClassX" extensions="ClassA, ClassB"> <apex:pageBlock> <apex:pageBlockButtons> <apex:commandButton value=...
1
vote
1answer
558 views

Quote Id returns null in extension controller

Controller : public with sharing class QLICustomerPricing{ Quote qte; public QLICustomerPricing(ApexPages.StandardController controller){ this.qte = (Quote)controller.getRecord(); ...
1
vote
1answer
525 views

VisualForce - Dynamically Update Contact Records based on selections made in Multi-Select style Data Table (Using Wrapper Class)

(Problem / Question listed at the bottom, below explanation content) Background: I've created a relatively simple VisualForce page with the intention of allowing our customers to update data ...
1
vote
2answers
235 views

Update user input value to a custom field

I have a below Visualforce page , where I am getting a user input using drop down selection. This input is for a custom field of an object which I need to update once I click save on the VF page. VF ...
1
vote
1answer
1k views

Sobject list as radio button Select Option

I am building a page where I have contact's first name and Last Name as an input field. When I enter the first and last name, and click search all the cases related to the contact should display as a ...
1
vote
1answer
880 views

Lookup field value in controller extension

I am creating a page where I am able to create a new case related the contact. In my controller extension in createCase() method, I am unable to populate the contact field( Lookup object on case). ...
1
vote
2answers
4k views

Re-rendering section on picklist value change - picklist value is always null

On a Visualforce page, I have a picklist (apex:selectOption). When a user selects certain values, additional input fields have to appear. Otherwise, they should be hidden. There are a couple of ...
1
vote
1answer
596 views

The installed managed class zqu.ProductSelectorController is not visible

I am getting this error trying to use a custom visual force page in place of a managed package visual force page. I made my custom controller global, thinking that it was mine that needed to be ...
1
vote
1answer
65 views

How to create contact detail page using controller? [duplicate]

How to create contact detail page using controller? <apex:page standardController="Contact" extensions="ContactDetailController"> <apex:form > <apex:pageBlock mode="maindetail" title="...
1
vote
1answer
443 views

How to access User's Profile fields in visualforce page Javascript portion

I want to access a custom field of my administrator profile in a Visualforce page which has a standard controller i.e. "Company__c". I want to access the custom field in javascript portion of that ...
1
vote
1answer
55 views

standardController & extensions

Created a Visual Force Page as follows: <apex:page standardController="Opportunity" extensions="c_Scrubber" docType="html-5.0"> the c_Scrubber.apxc class is constructed as follows: public ...
1
vote
1answer
63 views

Best optimized way to get logged in user info and set variables in apex controller

I want to know the best optimized way to access current logged in user's information and set few flags. I have a controller extension and I have set flags in constructor like this: User u = [SELECT ...
1
vote
1answer
92 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
3answers
152 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 ...
1
vote
1answer
962 views

Empty values in a picklist

Root-cause: From the controller alone, it adds empty values but it can be removed with javascript though the javascript doesn't work. VF PAGE <apex:column rendered="{!allowDiscount}" id="...
1
vote
1answer
849 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 ...
1
vote
1answer
794 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 code....
1
vote
3answers
1k 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 ...
1
vote
3answers
5k 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
3k 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 https://stackoverflow.com/questions/10556002/salesforce-how-do-i-pass-value-of-...
1
vote
1answer
3k 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 ...

1 2 3
4
5
9