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
0
votes
1answer
51 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
25 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
3answers
97 views

Save form - Lightning component

I'm trying to save custom object's records using lightning component , the form contain lookup fields ( multi select records ) , i have developed a LC to be able to select multi records on custom ...
0
votes
1answer
21 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
2answers
19 views

How to get language from visualforce into into controller extension

I am using a force.com site to show a visualforce page where I want the user to have the option to select a language. In the corresponding visualforce page I set the language. How do I get this into ...
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 ...
1
vote
1answer
61 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; ...
0
votes
0answers
25 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
1answer
60 views

How to compare a duplicate list values and delete it

I have a use case where in 1 Order Contains multiple OrderItems, and these orderitems contains records. lets say there are 5 orderitems to 1 order, and among 5 orderitems 2 are duplicate and 3 are ...
0
votes
1answer
21 views

Controller Extension - Report Data Tables

What is the correct way to declare and reference a report data table (in Visualforce)? The report is filtered by account, and I want it to be visible when rendered as "pdf". I'm writing a ...
1
vote
1answer
31 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
27 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 ...
0
votes
1answer
285 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
98 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
24 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
226 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
68 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
178 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
56 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
204 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
32 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
26 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
218 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
45 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
213 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
100 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
128 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
46 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
51 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
80 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
1answer
164 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
246 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
48 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
84 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
343 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 ...
2
votes
2answers
926 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
1k 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
845 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
861 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
2answers
621 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 ...
3
votes
1answer
455 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
321 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
535 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
381 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
174 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
140 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
1k 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
658 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 ...

1
2 3 4 5
8