Questions tagged [custom-controller]

A custom controller is an Apex class that uses the default, no-argument constructor for the outer, top-level class. You cannot create a custom controller constructor that includes parameters.

Filter by
Sorted by
Tagged with
-1 votes
2 answers
66 views

How do I fix Not Serializable: System.Savepoint error on custom Visualforce Page?

I am trying to use a Savepoint to rollback changes on a Visualforce Page (only when there is an Exception). I am using a custom controller with a custom save method (triggered by a button). When I ...
the-mad-neuroscientist's user avatar
1 vote
2 answers
41 views

Custom Controller Extension - Attempt to de-reference a null object An unexpected error has occurred

Trying to add a custom controller to a visualforce page and send through calculated values from that controller to the page to avoid lengthy formulas or conditional statements on the VF page. public ...
Tim Somerfield's user avatar
0 votes
1 answer
299 views

Pass data from Apex controller to VisualForce Page Help

Hello I am completely new with VF I am trying to pass some data from an Apex controller to a VisualForce. The situation is the next one I want to display in Google maps by using the Google Maps Api ...
sinpasharmi's user avatar
1 vote
1 answer
33 views

Salesforce Assignment checker claiming the output from my method is wrong when it's not

Trying to finish the final assignment for the Visualforce Basics, Create & Use Custom Controllers after checking the challenge it says as "The method 'getNewCases' isn't working as expected. ...
castithan21's user avatar
-1 votes
1 answer
50 views

Sales force org claiming my custom controller doesn't exist when it quite clearly does

currently having a bit of an argument with my org during a challenge as to whether or not the custom controller I wrote exists or not, I think it quite clearly does as shown in the screenshot below ...
castithan21's user avatar
0 votes
0 answers
32 views

Requesting Help with Writing an Appropriate Unit Test for My Apex Controller Class

I need help writing an apex unit test class for my apex controller class that is being used as an extension for a Visual Force page. The function of the class is to query "Intake__c" records ...
user avatar
2 votes
1 answer
281 views

Mocked imperative Apex method does not return mocked value

My lwc has an input and a button. When I press the button an apex call with the input's value is made. Even though the method is called with the right params, the return value is some sort of empty ...
Christian Llanos's user avatar
0 votes
4 answers
2k views

how can i parse nested json and form a final map with all the key and values from the nested json with mulltiple arrays [duplicate]

How can i Parse through JSON string with multiple subjson inside it in form of arrays and object. I want to iterate over the json depeding upon the key and value. Sample JSON: { "licClass&...
Shivam Raikwal's user avatar
-1 votes
1 answer
23 views

AccountContactRelation Variable In Apex Controller

I'm not receving any errors in the following, however the table in the VF page is not rendering. Would appreciate any advice on what is incorrect here, or if I'm completely going about this wrong. ...
George__202's user avatar
1 vote
1 answer
357 views

Count selected records in list view on visualforce page

I created a Visualforce page rendered as PDF, it has a concatenated header than include info from records selected, but specifically I'm trying to count total records selected. I created a class for ...
Paco Ortega's user avatar
1 vote
1 answer
88 views

Updating Controller to Include Tasks Related To Account Opportunities

I have been asked to update a Controller used for a custom 'Recent Activities' LWC on the Account layout. Right now the Controller is querying Tasks related to the Account and displaying them in the ...
sp2's user avatar
  • 67
2 votes
1 answer
41 views

Sites: Anyone not using "without sharing" on controllers?

We're developing a site, with vf pages and controllers. I'm curious if anyone is able to develop in this environment, accessing Opportunities and Contacts, plus some custom objects, without resorting ...
Dave Smith's user avatar
0 votes
1 answer
859 views

Delete failed. First exception on row 0 with id 0035i000008hdheAAA; first error: DELETE_FAILED

I am coming across the above error while deleting a record from the database. The vf page code is as follows <apex:page controller="EditAll"> <apex:form > <apex:...
Ali Baba's user avatar
-3 votes
1 answer
68 views

How to Convert Custom Controller to Standard Controller, I want to add VFP to Page layout, can anyone please help me with this [closed]

<apex:page controller="TrainingDeal" > <apex:form > <apex:pageMessages /> <apex:pageBlock id="pg"> <apex:pageBlockSection &...
Sunil Sugave's user avatar
0 votes
1 answer
40 views

Filter do not work. What is wrong with my code?

VF page: <apex:page standardController="Position__c" extensions="PositionsForJobApplications" recordSetVar="lineitems" lightningStylesheets="true"> &...
Oleh Shepard's user avatar
1 vote
1 answer
42 views

How to avoid saving other records in a custom VF page

I created a custom list of Event records using a custom controller and Visualforce page. In the list, the user can edit an Event but after saving the change, it also changes the last modified date of ...
Questioner51422's user avatar
0 votes
1 answer
107 views

Unable to do DML in controller when using Visualforce Email Templates

I have an <apex:component> that is tied to a VF email template. I am assigning the AccountId as the attribute. The issue now is that when I try to do a field update in the Account record (DML) ...
Krishnamurthy's user avatar
1 vote
1 answer
126 views

Why is my custom controller and visualforce page not outputting anything?

I am trying to create a simple VF page that is styled and has some info (name of two contacts related to the custom object, as well as the created date of the custom object). As I don't want the ...
Douglas Bryant's user avatar
0 votes
1 answer
696 views

How to display only primary contact of Opportunity

I just start to learn Salesforce and now I try to create VisualForce page that display info about primary contact. I tried to use {!Opportunity.OpportunityContactRoles.Contact.Name}, but that way I ...
Yauheni's user avatar
  • 29
0 votes
0 answers
72 views

Override required property on apex:inputField so that page can refresh?

I'm using fieldSets on a visualforce component and form. There is a formula {!OR(f.required, f.dbrequired)} for the required property. Main question, does this have to be modified with JavaScript? The ...
thinker's user avatar
  • 1,402
0 votes
1 answer
319 views

Apex Component Controller returning Null for simple string value

TL;DR Passing a simple string to component controller is returning null. I have already read this post but it didn't seem to imitate what I'm doing here. Pass value from apex component to controller ...
thinker's user avatar
  • 1,402
0 votes
0 answers
15 views

how to insert and save data after refresh in this code - salesforce (visualforce) [duplicate]

VF Page <apex:page Controller="contact_output"> <apex:form id="pg"> <apex:pageBlock title="contact" > <apex:pageblocksection ...
Umang's user avatar
  • 1
2 votes
2 answers
303 views

<apex:inputText> value not showing binding to my custom controller property

I am trying to achieve email-checking in a form. When the user types in an email address they can click the "Check email" button - which calls the ValidateEmail method in the custom ...
James Slater's user avatar
0 votes
1 answer
976 views

Join multiple JSON strings in Apex

I have a requirement to display Accounts-->child Accounts-->Tasks-->Child Tasks in the JSON. Here is my Apex code: List<Account> accountRecordsList = new list<Account>(); List<...
SFDCUser's user avatar
0 votes
1 answer
166 views

Passing values from Controller to VF Page

I have a requirement to display Account and its child Accounts using Gantt Chart. Here is my Logic: Controller: public with Sharing class Account_Gantt { public Account ParentRecord{get; set;} ...
SFDCUser's user avatar
1 vote
1 answer
202 views

Add Child Tasks dynamically in VF page created using DHTMLX Gantt Chart

I have a requirement to show Projects and its related sub tasks using Gantt chart in Salesforce. I have used DHTMLX as my base source. Here is my logic: <apex:page standardController="...
SFDCUser's user avatar
0 votes
2 answers
29 views

Visual force page not rendering the ouptput

I have a VF page which should display the opportunity data but when I search for the data using the input field i am not able to see any output and it's not displaying any output even it has the ...
SFDCSai's user avatar
  • 157
0 votes
2 answers
2k views

Apex Error: Illegal assignment from List<String> to String

I have a requirement to fetch Contact Region from Contact and update the same on User. Here is my logic: list<user> user = [SELECT name,Region__c from User where isactive = true]; Set<...
SFDCUser's user avatar
-1 votes
1 answer
99 views

Error while fetching Record values in Apex

I have a requirement to get all sponsor ids from Process record and store it on User record as multi-select picklist values. below is my logic: list<user> user = [SELECT ID from User where name =...
SFDCUser's user avatar
1 vote
1 answer
51 views

Visualforce: honor newline character from content retrieved by controller

I have a visualforce page that renders a pdf where the controller makes a call to an external service to retrieve legal content from a single source of truth. Someone, in their infinite wisdom, ...
Zach's user avatar
  • 107
0 votes
1 answer
1k views

Visualforce - Uploading Files via JSForce/JavaScript

I would like to upload an attachment greater than 135kb (view state limit) through Visualforce and link it to a new object record being creating via a custom controller. My understanding is that I ...
SpicyPat's user avatar
0 votes
1 answer
1k views

Aura Component not working as expected

I'm very new developer and I'm stuck. I'm trying to adapt an Aura Component that I found on internet to my needs, but I can't make it work (The original I found works fine). Basically what I want is ...
Ernesto Pastura's user avatar
0 votes
1 answer
216 views

PageReference method not returning null

I have developed a Visualforce page that takes an input file from the user and does not let the user proceed to the next page only if they did not upload an attachment (attachment is null). However I ...
SpicyPat's user avatar
0 votes
2 answers
138 views

Problems with building a custom controller in Salesforce

This is my first time having built a custom controller, and I in a revolving door of errors: This is the code with which I begin, and this DOES work: apex: <apex:page controller="...
PeterF's user avatar
  • 1
-1 votes
1 answer
296 views

Javascript Remoting salesforce unknown property remote action

My VisualForce page: <apex:page docType="html-5.0" controller="JavascriptRemotingController" showHeader="false"> <head> </head> <body id="bd&...
Zan3's user avatar
  • 43
0 votes
0 answers
69 views

VF - Can you create a multi-page wizard to save a single record?

I have setup a wizard that uses multiple VF pages and a single custom controller to guide the user through a user-friendly form and create a single custom object record. I tested out the wizard but ...
SpicyPat's user avatar
0 votes
1 answer
754 views

Variable is not visible - get set

I have a controller for a Visualforce page that uses a getter and setter method to initialize a custom object Application__c however it is throwing strange errors that I did not previously get when ...
SpicyPat's user avatar
0 votes
1 answer
628 views

VF Page is not updating the record

I have a VF page to update couple of fields on the Opportunity record, it is a simple VF Page like below <apex:page standardController="Opportunity" extensions="Opportunity_UpdExt&...
user81642's user avatar
  • 667
0 votes
1 answer
229 views

Data Mapped from controller is not visible in VF page

I have tried retrieving values of data from the controller and map them to the VF page. But, the mapped data is not being visible on the VF page, whereas in the debug of the controller it is visible. ...
Rahul Allada's user avatar
0 votes
1 answer
239 views

How to display recently created record link in visualforce Email Template without using an Apex Custom Controller?

I have objects with lookup relationship "A"(Parent) and "B"(Child). Email need to be sent to User whenever a New record "B" is added on "A" and Email body ...
Rupa's user avatar
  • 15
0 votes
1 answer
1k views

Order of execution of getter setter methods in Custom Controllers

I am trying to learn custom list controllers but struggling to understand how the getter and setter methods execute using standard set controller. Can anyone please help with code comments as to how ...
Krishnamurthy's user avatar
0 votes
1 answer
258 views

Document not uploading to notes and attachments from VF page

I have a VF page where the user is to upload a file and a custom controller to save this to the notes and attachments section of the object record. I'm receiving the following error when hitting the ...
patriciajlim's user avatar
0 votes
1 answer
122 views

Apex:inputField values not inserting

I have an <apex:form> that gathers user input for various fields on the recipient__c object and a custom controller that inserts the new record. Further in the controller I have another object ...
patriciajlim's user avatar
1 vote
1 answer
148 views

How to update related record with parent field in VF custom controller

What I have in my custom controller is an assignment when a user inputs a value for a certain field, the field for its parent object will update as well. For example. User inputs the school for a ...
patriciajlim's user avatar
0 votes
1 answer
587 views

Insert parent and child record and reference parent in a single VF page

I have a VF page that inserts two records in a single page: Insert recipient__c object with required fields: school__c Insert scholarship_award__c object with required fields recipient__c, year__c, ...
patriciajlim's user avatar
0 votes
0 answers
166 views

Save two objects in a single VF page using custom controller

I am in the process of developing an apex:form that will save two records: Recipient__c and Scholarship_Award__c. I need to create a custom controller to save new records for both objects on the same ...
patriciajlim's user avatar
0 votes
1 answer
182 views

Issue with file count on Custom object

I have an apex class which updates the files count on custom object called Declined_Policy__c. Below is my apex class: public with sharing class Policy_FileCountClass { public static void ...
SFDCUser's user avatar
0 votes
1 answer
274 views

Remove selected text from text area field

I have a field called description which tracks all the changes made to "Add to Description" field. When the description field is blank and any new value is entered into Add to Description ...
SFDCUser's user avatar
0 votes
1 answer
440 views

Null pointer exception while using Trigger.newMap.keySet() [duplicate]

I have a requirement to update contact field on MC Subscriber Activity when the contact email id matches with MC Subscriber Activities field. Below is my trigger: trigger MCActivityonContact on ...
SK_112's user avatar
  • 73
0 votes
1 answer
970 views

setCallback returning error state for saving records to salesforce

currently I’ve been following the aura components module in trailhead, with the main variation being that I'm using the Opportunity object, and I’ve run into a road block. For some reason when I try ...
Apex_rookie's user avatar

1
2 3 4 5
7