Questions tagged [controller-extension]

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

65 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
338 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. ...
4
votes
0answers
225 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 ...
4
votes
2answers
178 views

controller extension not found

I created a controller extension for the Contact object. I don't know if it will work or not, because I can not test it. Salesforce is acting like my controller extension does not exist. Error: ...
3
votes
0answers
298 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 ...
2
votes
2answers
91 views

Apex Test Class Failure: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]

I am at a loss for this one and could really use some help on this. I have a vf page and apex extension that is used with a site. Everything works when I test this via the UI but for some reason I am ...
2
votes
0answers
89 views

How to read SalesForce IdP SAML Assertion in Custom Controller

in our implementation. I need a way for my custom APEX codes and controller to be able to retrieve the SAML assertion generated from the SFDC platform (IdP). So I can pass the assertion to the ...
2
votes
0answers
690 views

Dependent class is invalid and needs to be recompiled

I have written a controller extension and am having difficulty deploying it to production. The extension allows a flow embedded in VF to finish on a Case record created during the flow. The error I ...
2
votes
2answers
2k 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 ...
2
votes
2answers
4k views

field validation on approve or reject for approval process

I am creating an Approval Process. Its a simple process with 2 approval steps I have a requirement where an assigned approver (user) must populate one or more fields on a record before they approve or ...
2
votes
1answer
1k 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. ...
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 ...
1
vote
1answer
21 views

How to query for the object message__c in my program?

a lot of you might find my question really basic but I am beginner. I am writing a visualforce page and here is my code. public class CustomControllerExtension1 { public Account ...
1
vote
1answer
490 views

How can i open a pop up box with event information when event url is clicked in the Full calendar?

I used jquery full calendar and this pageload() on document.ready with list of events in calendar. Here is my Controller: <apex:page controller="NetworkCalendar" standardStylesheets="false" ...
1
vote
0answers
47 views

Conditionally Validate fields on VF page

Here is what I need, I have 12 * 3 (36) number fields named after each Month(Jan,feb,march...etc,.) on the VF page for 3 years 2016, 2017 and 2018. Now, if my start date is Jan 2016 and end date is ...
1
vote
1answer
377 views

Visualforce page usingbase standard controller

I have the following Visualforce page and controller: <apex:page standardController="sObject" extensions="ExtensionController"> <div> {!o.Id} </div> <div>...
1
vote
0answers
60 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 ...
1
vote
0answers
401 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
0answers
1k 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 ...
1
vote
0answers
68 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 ApexPages.currentpage().getParameters()...
1
vote
0answers
476 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 ...
1
vote
0answers
663 views

Issue with overrided Cancel button not update related fields

I am implementing a visualforce page with a customized 'cancel' button and 'cancel' function in the controller extension Here is the sample code <apex:form> <apex:pageblock> <...
0
votes
1answer
25 views

HELP displaying related contacts of all accounts in hierarchy?

I want to show in child accounts, the related contacts of the parents and other child accounts too. I almost solved this with a Visualforce Page and a Controller, but the related contacts are shown ...
0
votes
1answer
56 views

Upsert failed.INVALID_ID_FIELD, record id cannot be empty key: []

I'm a beginner developer and I'm building a custom NEW contract button. I'm having issues getting the contract to insert/upsert and I think it has something to do with having a standardsetcontroller ...
0
votes
1answer
26 views

Attempt to de-reference a null object error after selecting Visualforce page dropdown value

I'm a beginner developer and I'm building a custom new contract button with a visualforce page with dropdown field values that unhide other fields depending on what is selected. Clicking the button ...
0
votes
1answer
24 views

Save button (associated to standard controller method) not working on visualforce page (standard controller + extension)

I'm creating a VF page with a list of all contacts on the top and a form to insert a new one on the bottom but the last feature doesn't work. This is the code of the VF page: <apex:page ...
0
votes
1answer
33 views

Unable to get the edited values to Controller without using wrapper

I tried searching for a solution before posting it here but no luck. I have a VFP with account fields and custom InputText field which is used to capture "Other" value which is concatenated(some ...
0
votes
0answers
17 views

Insert URL parameter into Apex controller extension save function

I am trying insert a parameter into the record that already exists and then put in the save method in an apex controller extension for a standard controller. This is the controller extension pretty ...
0
votes
0answers
26 views

Why does VFP execute twice in community context when email is sent from controller constructor?

In community context, I wanted to create a simple VFP (VerifyYourIdentity) that accepts the verification code sent in email and upon entering the same code, it should take to next VFP. For the same, I ...
0
votes
0answers
76 views

SFDC Flow Launched from Custom Button

I have a custom button on the Opportunity object that launches a Visualforce page. The Visualforce page passes the Opportunity ID to the Flow then launches it and sets the finish location. I know my ...
0
votes
1answer
195 views

issue with userdata in test class for auto registration handler class

I have a test class which is as below @isTest private class KC_Reg_Handler_Test { static testMethod void testCreateAndUpdateUser() { KC_RegHandler handler = new KC_RegHandler (); ...
0
votes
0answers
38 views

How to refresh a Visualforce table when the method returns a list

How can I reload a table on a VF page that uses Account as the standard controller? I have an extension as well which supplies the data to the table. Visualforce Page: <apex:page ...
0
votes
1answer
170 views

Delete button not working in Lightning

I want to enable the button delete function, but not working. :( see my abbreviated code. Apex Class: @AuraEnabled public static Boolean deleteCliente(Id lstClienteId) { Cliente__c n = [SELECT ...
0
votes
2answers
920 views

How to pass multiple selected values from apex:selectList to controller?

I haven't been able to find an answer to this as all the answers are somewhat different to what I'm trying to achieve. Summary before giving the details: apex:selectList where the values are ...
0
votes
1answer
243 views

How to call Same vf page from another VF page with Output Fields?

I have two VFpages In 1st VF Page: I have a 3 input field and I am entering data I have a button(Standard/custom). When I click on this button, It should redirect to another page(2nd VF Page) ...
0
votes
1answer
125 views

Error in Visualforce page with standard controller and continuation in extension controller

This is the error I get with the following controller and visual force page: Error: Unknown method 'Module_Test2__CM_Components__cStandardController.renderResponse()' Error is in expression '{!...
0
votes
1answer
120 views

How do I export feed placed on any Account record in the PDF format?

Can anyone tell me how we can export feed placed on any account record as PDF. I want to do this via custom Button that will export the feed in as pdf ?
0
votes
0answers
130 views

Issue with StandardController addFields() on WorkOrder sObject

I am overriding the 'New' button on the WorkOrder standard object with a Visualforce page. My users will be creating their WorkOrder records from the Case object. I want to get the CaseId using the ...
0
votes
1answer
137 views

Two Vf pages, one controller

I have Vf pages on Opportunity and contact.i have continue button to redirect opportunity vf to contact vf. i want to auto-populate fields from opportunity vf page to contact vf page. i'm using one ...
0
votes
0answers
132 views

Controller property not binding itself properly to page

I have a list of opportunity wrappers. When I click on one, I bring up a separate div (within the same page), binding it to the opportunity wrapper that I clicked on: public void prepPrintSingleForm(...
0
votes
0answers
201 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 ...
0
votes
1answer
397 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 ...
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
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 ...
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 ...
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 ...
0
votes
0answers
211 views

Pass value from VF to extension

I am facing a behaviour I cannot understand. The feature works fine with custom controller, but not with standard controller extension. Essentially I have inputHidden field which value I update with ...
0
votes
1answer
115 views

Open record details in a panel within a Visualforce page

I have written a bootstrapped page that has a custom list view panel on the left side of the page and an output panel on the right side of the page. I have the left panel figured out where different ...
0
votes
1answer
57 views

Regarding Visualforce Page and customization

I have created the Visualforce Page ,if that page is Viewed by Particular user,their count and name should be recorded in the record of custom object,for every user count is different,is it possible ...
0
votes
1answer
31 views

Access VisualForce page with specified credentials

I want to create a VisualForce login page.Only my contacts with their username and password which is filled in the custom fields of account object should be able to redirect to next page.