Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [controller-extension]

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

0
votes
1answer
32 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
35 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
29 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
23 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
59 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
19 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
75 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
25 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
57 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
55 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
39 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
32 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
52 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
17 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
36 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
195 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
205 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
239 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
194 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
49 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
235 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
101 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
145 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
263 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
204 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
102 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
51 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
481 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
166 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
0answers
31 views

How do I set rendered to false for apexoutputPanel based on custom sObject property?

I have a custom sObject, my_event__c. I added a checkbox field in the Salesforce UI called 'Hide_Buttons__c'. If this item is checked on the record, I have an outputpanel on a VF page, that I want to ...
0
votes
1answer
42 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
137 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
44 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
98 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
55 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 ...
0
votes
1answer
110 views

Visualforce - infinite redirection loop

I have the following Visualforce page that overrides the "View" action of a standard object: <apex:page standardController="Opportunity" extensions="OpportunityDispatcherCx" action="{!redirect}"/&...
0
votes
0answers
83 views

Visualforce iframes don't work from mobile app

I need to include an external website inside a page or redirect the page viewer to an external website. To achieve this I tried a few methods: Visualforce page with javascript that redirects - this ...
2
votes
1answer
431 views

get set from controller extension to visualforce page

I have a controller with extesion from which I try to pass the subtitle values to my visualforce page but I cant seem ro render it. My system.debug('subtitle 1 '+ subtitle ); gives : subtitle 1 {...
1
vote
1answer
55 views

Visualforce parameter passing to controller in sandbox, but not production

I have a visualforce page that runs a flow and use a custom controller extension to set the finish location based on the user profile. (Basically it re-directs back to the original opp record, which ...
2
votes
1answer
115 views

How should I write and structure a good Apex Page Extension Test method?

I'm on the Advanced Apex Specialist Superbadge step 8 and I'm writing the test class, but what they are asking for seems different from what I've been taught about test methods. I thought that I ...
2
votes
1answer
138 views

Fetching related objects data from standardcontroller extension into visualforce page

public class TrackerExt { public String OpportunityId {get;set;} private final Opportunity opp; public List<Tracker__c> trackers{get; set;} public TrackerExt(ApexPages....
0
votes
1answer
77 views

reference in visualforce the lookup field on child record in master detail

<apex:pageBlockTable value="{!oldSubscriptionAndAsset}" var="assetAndSubs"> <apex:column> <apex:facet name="header">Asset</apex:facet> <apex:...
0
votes
3answers
947 views

Getting selected value from <apex:inputField> (dropdown) to a controller variable

I am working on a custom VF page for a case screen with extension controller class in use. <apex:actionRegion > <apex:inputfield label="Action" value="{!case.Action__c}" id="Action" > ...
0
votes
2answers
31 views

System.NullPointerException: Attempt to de-reference a null object(about feeditem object)

I'm trying to add an action on Visualforce Page which enable end users to post messages on a case. But when I click the button, I get an error like: System.NullPointerException: Attempt to de-...
0
votes
1answer
142 views

Redirecting to new Record after inserting does not work

this is a follow-up question to: How to clone and selectively change fields on cloned object? Situation: I want to clone a custom object, update a few fields and insert the cloned object into the ...
0
votes
1answer
32 views

Issue using a standard controller and an extension

In a VF page I have a table like this : <apex:pageBlockTable value="{!lPrest}" var="prest"> <apex:column> <apex:facet name="header">Prestation</apex:facet> ...
0
votes
1answer
652 views

Insufficient access rights on cross-reference id, while attaching a file to case

When the user is trying to attach file in vf page its getting error. But the user is able to attach file from UI directly to the same case. OWD is Private for the case object and when we give ...
-1
votes
1answer
1k views

Delete records in Visualforce page data table [closed]

I created a Visualforce page with the following controller extension: public class StudentsControllerExt { public student__c NewStudent {get; set;} public StudentsControllerExt (ApexPages....