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

Custom component setter value being passed in to controller, but getter always returns null (or the initialized value)

The setup: I have a standard controller with two extensions on it. <apex:page standardController="Contact" showQuickActionVfHeader="false" extensions="ExtOne,ExtTwo"> <c:...
0
votes
1answer
23 views

Test Class For FinishURL StandartsetController

I have an APEX class that ends with a finishURL method; this class is the controller-extension of a VF page. What they all do is to collect the IDs of the selected items on a related list view, then ...
-1
votes
0answers
26 views

InputField for map of <String, List<Sobject>> [duplicate]

Below is my map in which I need to capture input values on a VF page public map<String, list<PRA_Question__c>> PRQuestions = new map<String, list<PRA_Question__c>>(); ...
0
votes
1answer
37 views

How to get ID from aggregateresult[] groupedresult

I have an aggreateresult[] soql as follows: AggregateResult[] groupedResults = [SELECT id, Account__c, Account__r.Account_ID__c, MAX(Account_c__C) FROM ...
0
votes
1answer
30 views

Display the Variable vale in the VF Page from Extension Class

Req is as below: I need to display the variable from the extension class of the Standard controller: Variable name is : String unreleasedCheck{get;set;} String unreleasedCertificat{get;set;} VF ...
0
votes
1answer
20 views

How to fix Custom URL controller - public page - Authorization problem

I've got a controller extension I'm trying to deploy to a public custom url. It works in our sandbox, and I can access it with "Preview" under the custom url, but I get the dreaded Authorization ...
2
votes
1answer
31 views

How to auto populate the lookup field value into the text field in visualforce page?

I am trying to auto populate the value of lookup field to text field in the visualforce page. As soon as I select the value of lookup field from the list the value as it get populated in the lookup ...
0
votes
0answers
35 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
57 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 (); ...
1
vote
1answer
26 views

how to make test class for controller with parameter canvas.toDataURL()

I made extension class and VF page for getting signature image. I confirmed it works well through many test . And then, I need to make test class to deploy that extension class into production org. ...
1
vote
1answer
71 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 ...
0
votes
1answer
30 views

Issues with insert/creating a record in custom object using custom controller

VF Page <apex:page standardController="Applications__c" lightningStylesheets="true"> <apex:sectionHeader title="Application For Employment"/> <apex:form > <apex:pageBlock >...
0
votes
0answers
16 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
0answers
48 views

URL.getSalesforceBaseUrl() function is not working as expected in Lightning experience

I have a Custom button which uses Visualforce page with a custom controller. Custom controller's save function does some calculations and redirects to Origin record page where my custom button is ...
0
votes
1answer
77 views

with sharing without sharing vs extension?

While going through manuals, it was mentioned Many times that apex classes will not consider security of logged in user but it will run in system mode and we should add custom controller extension to ...
0
votes
2answers
42 views

Retrieving list variable value defined in a method in a class into visualforce page

I am trying to retrieve the list variable into visualforce page which i have defined in a method inside apex extension class. I am getting error, could anyone please help. In the below code in vf page ...
0
votes
1answer
50 views

How to fetch apex:input field value into extension class

I am trying to get the value that user enters for the Start Date and Team Name fields into the Extension class as mentioned below but i am getting Null. Could someone please help. VF page: <apex:...
0
votes
1answer
30 views

Get field information from a record/object selected as a lookup field

I have a VF page that uses standard controller Account and an extension DonorSearchCon. When I select a Regional_Chapter_Name__c lookup field, from my VF page, I would like to query the record, and ...
4
votes
1answer
92 views

Can you output map values in visualforce inline using a string key?

Can you output a value from a map in a custom extension without or it being in a table? Tried the below and did not work. example extension: public without sharing class Example { public List<...
0
votes
1answer
34 views

Creating text box with magnifier to search and select account from org

I am trying to develop a Visualforce page to search account and select from the org. Like we select an account on the contact. Need something like this on the page: Controller: public with sharing ...
0
votes
1answer
50 views

Need to find a method for an extension class that filters the a certain value of the current shown record

I am trying to find a method to query a certain dynamic value and make the results visible in the standardController. Background: we want to display all leads who have the same date field as the ...
0
votes
1answer
77 views

We want to get a list of lead and opp. that have the same date (custom fields) in the record as the actual shown lead

What we did so far... We created a visual force page that calls a class and added an extension to get the ID. We got some Error :) (We try to get the ID for the currently displayed Lead, which ...
0
votes
0answers
30 views

Updating child records of a custom object with parent object's standard controller and extension to find related children

so I have a VF page in effect that grabs the child records (Child__c) from a parent record (Parent__c) to fulfill(remedy in this case) a mass update request for the child records of the parent. The ...
0
votes
1answer
92 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 ...
1
vote
1answer
104 views

How to generate pptx files with the VisualForce page and Apex Controller

Unable to open the generated file in OpenOffice unfortunately. My requirement is to generate a ppt file using dynamic data from Salesforce. Here is my snippet of Visualforce Page. <apex:page ...
2
votes
1answer
41 views

Get name of standard action overriden in Visualforce contorller

I have a visualforce page that overrides both the 'New' and 'Edit' Buttons of a custom object. In my controller extension how can I get the name of the action that called this page ? I don't see ...
0
votes
1answer
12 views

How to post a list of all open positions in a visualforce page without using a Custom Controller?

We want to post all open positions (custom object) to a Visualforce page. I want to keep all the standard functionality of the standard controller, but only show Positions with Status = "Open". ...
2
votes
2answers
37 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 ...
1
vote
1answer
153 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 ...
0
votes
0answers
21 views

Mailing Address Suggestions not showing in Lightning Component

I have a lightning component which is used in the community. When I have added mailing address field in the code, I can able to see the field but suggestions are not coming as we see in lightning ...
0
votes
0answers
38 views

Einstien Analytics Dashboard error: Aggregate query must have measures

I have a requirement where the old dashboards(created earlier to 2017) should be converted to new dashboards. Now when I click on "New Dashboard Designer" from old dashboard edit page, I will get a ...
2
votes
2answers
463 views

Variable is not visible

I have this variable which returns key from custom settings. below is the code related to this private static String AccLinks { get { if (Acclinks == null) { ...
1
vote
1answer
474 views

Test Class for Controller Extension Visual Force Page

I am trying to test my controller extension, Although the final score coverage hit into 100% but when i checked my tests log in my dev console i got Error. This is the ERROR Message: System....
0
votes
1answer
433 views

How to pass list view selected items from one visualforce page to another

So I have a custom object called Transactions, and have recently made a list view button that will redirect the user to a visualforce page that will show the selected record, and provide a few buttons ...
0
votes
2answers
413 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
0answers
98 views

Visualforce - Passing data from a child visualforce component to a parent visualforce page

I have successfully created a visualforce page (parent VF page) that includes a visualforce component (child). Using the parent controller, I need to retrieve a variable (a list of custom object) ...
0
votes
2answers
323 views

How to Redirect same page After clicking save button?

I have created visual force page for updating records from the page. . in my code Owner__c is Parent, Vehicle__c is Child. once i enter value owner object discount__c field , i need to update same ...
2
votes
1answer
206 views

Save PDF Visualforce as attachment - mergefields not showing

I really need your help because I'm completely stuck. I want to render a PDF from a Contract in Salesforce, and save it as a record's attachment. I followed several tutorials and I created a PDF ...
0
votes
1answer
185 views

How to attach a file to a custom object from a visualforce page in lightning experience

I need to attach a file to each record of a custom object from visualforce page in lightning experience.Here the i have tried so far but this fails to attch the file. VF Page: <apex:page ...
-3
votes
1answer
319 views

How to call this pointer in static context [closed]

I have one static class in that where I'm calling one methods using this pointer in my apex class, I'm getting below error. This cannot be referenced in a static context below statement shows you ...
1
vote
1answer
263 views

Variable does not exist in method

I am trying to pick up the value of a visual text input and validate if it exists in the database, the problem is that it throws me the following error "Variable does not exist: searchDir" I leave my ...
0
votes
1answer
135 views

How to add new lead to related list of custom object?

i have overridden new button of lead object. My requirement is to add lead object to the related list of the custom object "journey". I have created a lookup field called Journey id on lead. I have ...
1
vote
1answer
87 views

Getting multiple values from controller to visualforce page?

So I'm still very new to coding and Apex. I have a custom object called Invoice that is a part of a managed package that some users in my org do not have access to. So basically what I'm trying to do ...
1
vote
2answers
772 views

Add Custom Error Message to VF Page

I am trying to add a custom error message to a VF page. My controller saves, but when I save my VF page without the checkbox field being checked, it saves anyway and bypasses the error condition in ...
0
votes
1answer
311 views

Unknown constructor

I have a page that creates a CSV of account and related data, i am trying to add a block that shows the users related to that account via a contact. I have followed a few tutorials on how to make a ...
0
votes
1answer
87 views

Visualforce inputField Isn't Saving to Variable

Here's the piece of my markup that includes the inputField: <apex:form > <apex:pageBlock mode="edit" rendered="{!reportAppRendered}"> <apex:inputField value="{!...
0
votes
1answer
252 views

How to dynamically provide options and update a field when an option is selected [closed]

The code I wrote is not setting updating the field on the same window, and my other method would refresh the page, and field is not updated until I refresh the page manually. My goal is to provide a ...
0
votes
1answer
81 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) ...
-2
votes
1answer
99 views

Null reference in loop?

I'm getting this error: System.NullPointerException: Attempt to de-reference a null object when I'm trying to pass child records to new record creation(order_LIne_item__c). Here I have nested ...
1
vote
2answers
57 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 ...