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
2answers
462 views

Writing a test class for a read only Visualforce page

I am trying to write a test class for a Visualforce page, which returns a list of associated records to the contact object. The test class is throwing no errors, however is also not covering the ...
1
vote
1answer
385 views

Apextest: Calling addFields, Fields needed in Extension

I'm trying to write a test class for my controller extension. In this extension I used addFields to add custom fields which i already filter with !Test.isRunningTest(), so it wont cause an error ...
0
votes
1answer
662 views

How to get a Javascript variable to the apex controller class

Below is a VF Page I have. I do get the alert message with the URL. I am unable to get theValue variable value in Apex controller. Am I missing something here? <apex:page standardController="...
0
votes
0answers
203 views

Showing error message based on the source of page

I have a challenging scenerio here. I am using a VF page as a view page(ViewVF) ( which has detail page tag and apex pagemessage tag in it). I have a button on this detail page which does some ...
1
vote
3answers
181 views

QueryString value is accessed in method but not in constructor from Test Class

I am a newbie to salesforce and currently is learning Apex Test Classes. Here i came up with a situation that when i use accId = ApexPages.currentPage().getParameters().get('account'); constructor,...
0
votes
1answer
425 views

A Visualforce logic for a custom button invocation

I have detail page and a custom button(Make Callout) which invokes a apex callout and does some validations. Below is the code of the VF page of the custom button: I have the tag so that I can show ...
0
votes
2answers
771 views

Display apex pages message on Detail page

I have standard salesforce detail page on which I have created a button. I am trying to make a callout from this button so I created a VF page and controller (from where the callout will be made). I ...
2
votes
1answer
798 views

Unknown property 'AccountStandardController.showOpps

I want to Render a section of my Visualforce page only if I found Opportunities related to the Account I'm working with and I'm getting this error message. I have a VF Page and a controller extension. ...
0
votes
1answer
401 views

Is there a way to make a PageReference method an InvocableMethod?

This is the scenario: I had a VF page call a controller extension,that would have some criteria and redirect the user to a different page (or not, depending on the criteria). Now, everything starts ...
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
1answer
543 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
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
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 ...
2
votes
2answers
676 views

How to iterate over pageblocktable dynamic component inside controller

All, I am trying to use dynamicComponent to build a PageBlockTable. In the controller I want to iterate over each element and perform certain operations. My VF page looks something like this <...
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}" ...
0
votes
1answer
31 views

Need help sending class and VF page to production

I am unable to get an apex class into production from my sandbox I assume it is because i have not written any tests Could someone help me write some tests for this class so i can get it over to ...
0
votes
1answer
30 views

Controller Extension Testclass

I have problems creating an appropriate testclase to my controller extension. I have a VF page on opportunities which creates for a certain type of opportunity 4 independent (quarterly) opportunity ...
0
votes
1answer
447 views

add data into custom pdf

I have created custom Controller extension and VF page for PDF generation: public with sharing class AccountPDFController { public String fileName {get;set;} public AccountPDFController(...
0
votes
1answer
82 views

Trying to pass the id parameter into a VF page that is part of the opportunity layout

There is an object called milestones__c that is a child of the opportunity. I am trying to retrieve the milestones of a given opportunity and display them. Here is my controller extension public ...
0
votes
2answers
7k views

How to display List values in VF Page

Apex Class: public class RelatedController { public Case selectedCase { get; set; } public List<VEH_Veh__c> selectedveh { get; set; } public RelatedController () { ...
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; ...
0
votes
1answer
45 views

Configuring Simple Extension for Cross-Object VP PDF output

I have no experience with Apex coding or programming in general, so please be very basic in your responses. I have a button on my ctOppty__c object creating a VF pdf page from my ctOppty__c object ...
1
vote
1answer
325 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" ...
0
votes
1answer
35 views

Extension class giving error as Method does not exist or incorrect signature

I have written extension class for a page. Class is giving error as "Error: Compile Error: Method does not exist or incorrect signature: ApexPages.CurrentPage.getParameters() at line 8 column 17"...
0
votes
1answer
64 views

Help with Test Class

All, I'm working on writing a test class for below controller however it keeps failing. This VF page allows to enter hierarchy of records in one click. When I'm trying to test this, it keep failing ...
1
vote
0answers
92 views

Visualforce component field value bind issue

I have following class /** * extension class for handling VF page actions */ global with sharing class SQX_Extension_Random_object extends SQX_Controller_Sign_Off { private ...
0
votes
0answers
64 views

Test Class Coverage not 100%

I am trying to develop a test class for a VF page controller, but I am not able to get some of my lines covered. Specifically, I am having trouble covering lines 54-58 and 75-79. Can anyone help ...
3
votes
1answer
418 views

Problem with field validation on a visualforce page with a controller

I have a custom object with a visualforce page, 2 controllers, and a custom button. The issue is if I use the "Save & New" custom button my validation for a field won't show the error on my page. ...
0
votes
1answer
58 views

Visualforce Page Error

I am getting an error when I try to save data from a Visualforce page calling a controller method. Can anyone help me figure out how to avoid this error? The error is: List index out of bounds: 1 ...
0
votes
3answers
157 views

Visualforce Error Message

I am getting the following error message from my VF page and controller extension. Does anyone know how to resolve? apex:inputField can only be used with SObjects, or objects that are Visualforce ...
0
votes
0answers
37 views

Visualforce - Show PageBlockSection upon CommandButton Click

I have a VF page with a custom Extension controller that creates a task or series of tasks on a button click from the Contact page. Users have the ability to create an initial task then a follow up or ...
2
votes
1answer
308 views

Passing Visualforce InputField to Controller

This is probably a simple fix, but I'm struggling. I have a VF page that pre-populates Task fields via a controller extension. I want to then give the user the option to create a follow-up task. I ...
4
votes
1answer
1k views

How to call controller extesion action from VF component

This question is similar to How to call a standard controller action of a VF page from a VF component, but there are two differences I see: I'm not using a standard controller the <apex:form> ...
0
votes
1answer
584 views

Unable to update textArea field from Save Commandbutton in Apex Custom Controller Extension

I have an object VF_Page_Update__c which has a picklist field called VF_Page_Picklist__c and a textArea(255) field Update__c. I am dynamically showing the picklist values in the Visualforce page I ...
2
votes
1answer
367 views

Visualforce Controller for Multiple Tasks

I have the controller below for a Visualforce page set up on the Contact record as a Detail Page button. The purpose is to allow users to set up multiple tasks at once, but also pre-populate the ...
1
vote
1answer
84 views

Visualforce save only changed objects [closed]

I have a visualforce page with a custom save method in which I'm saving multiple objects. I want to save only those objects which got modified. Currently I'm doing an upsert on all objects when save ...
0
votes
1answer
520 views

VisualForce Error Content cannot be displayed: Invalid conversion from runtime type sObject to sObject

I want to understand this error as I have never seen this before. Content cannot be displayed: Invalid conversion from runtime type L1dlF0rm0rg__Case__c to ICIX_V1__ICIX_Product__c Background: ...
3
votes
2answers
272 views

Can a single VF page override both a standard action and a list action?

To minimize the complexity and number of distinct pages in my org I would like to use a single VF page to override both the standard Delete action and create a Delete list view action that allows a ...
2
votes
2answers
1k views

Redirect to another VF page while using a Same Controller?

I have the following scenario :- I do some query on a page using user input. User makes changes to the query and click 'Update' button User is redirected to a new page for confirmation where they are ...
1
vote
1answer
103 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 ...
2
votes
1answer
4k views

Decision to use Custom Controller rather than Controller Extension

I came up with one question which asks me to select two options. Question is: When would a developer use a custom controller instead of a controller extension? Options are: When Visualforce page ...
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 ...
3
votes
1answer
483 views

SObject row was retrieved via SOQL without querying- Using Dynamic References

I am referring to a code from salesforce documentation https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_dynamic_vf_sample_standard.htm where it is shown how to build a list ...
1
vote
1answer
275 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 ...
0
votes
2answers
544 views

Visualforce Page with Standard controller not updating parent record

I have a relatively simple VF page that is launched from a button on a custom object called 'Inclusion_detail__c. The page uses the standard Controller and is effectively a data entry form for ...
0
votes
1answer
94 views

Visualforce and Apex accessing Object before saving with controller extension

Updating because my question was not clear: I'm trying to override the new and save functionality of a Custom Object on Visualforce page via a controller extension. Here's my .vfp code: <apex:...
0
votes
2answers
955 views

Delete link on visualforce page fails to delete record

I have done in the sorting, pagination and alphabar navigation and edit/delete link on the same page in standard controller/standardList controller. However, the delete link is failing to delete the ...
0
votes
2answers
257 views

How to provide the refresh button it's refresh current page and showing the same result in apex?

to all. I am trying to provide the refresh button on my page it's have only done on "Refresh the current result of the page and showing the same result". But I have the idea only for that page and I ...
0
votes
1answer
91 views

Alpha navigation bar is not working?

To all I am trying to add the alpha navigation bar to be in my page,It's also to be have the sorting and pagination itself.as like as My Controller , public class StandardPaginationSorting { // ...
0
votes
1answer
225 views

Error: Unknown constructor 'StandardPaginationSorting.StandardPaginationSorting(ApexPages.StandardController controller)'

to all I am trying to provide the sorting and pagination on standard controller with extension by followingly,My controller public class StandardPaginationSorting { // Variables required for ...

1 2
3
4 5
9