Stack Exchange Network

Stack Exchange network consists of 174 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 [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.

0
votes
0answers
12 views

Not full URL in Referer header in a controller of a Visualforce page

I added a custom VF page in a Dashboard. I want to have the Id of the Dashboard in my controller because I need it in my script. So, I used ApexPages.currentPage().getHeaders().get('Referer'). In ...
0
votes
1answer
23 views

Custom Controller and VF Pages for a Kanban

Looking to get a little help with a custom controller and VF page for a Kanban we will use on our home screen. I have used the code from https://shrutisridharan.wordpress.com/2016/08/22/creating-a-...
0
votes
2answers
24 views

Unable to get Visualforce page form input values in Custom Controller

Controller: public class updateOpp{ public String Name {get;set;} public Boolean selectRecordDel {get;set;} public PageReference submit() { system.debug(Name); system....
0
votes
1answer
20 views

while calling method showing variable undefine in lightning component

This page has an error. You might just need to refresh it. Action failed: c:SComponent$controller$arResult [str is not defined] Failing descriptor: {c:SComponent$controller$arResult} when click ...
0
votes
1answer
53 views

Unknown property 'String.Id'

I am trying to update a VF page and add a new field but am getting an error Unknown property 'String.Id' The field that I am trying to add is Descriptio__c, a depending picklist to Task_Type__c. ...
1
vote
1answer
69 views

Visualforce Input Fields not being passed to Controller

We're running into an issue where values being entered into a Visualforce page are not being passed at all to the controller for the save actions that take place. I'm sure this is something simple ...
0
votes
1answer
28 views

Getting values from picklists into visualforce controller

I'm creating a VF page on Opportunity Products where I have an apex:repeat and inside the repeat, I have a picklist that gets it's values from a SOQL query on a related object. I have no problem ...
0
votes
2answers
69 views

Visualforce Render condition not working when true

I have a custom visualforce page that has page blocks. When the render condition is false, I receive the expected results when previewing. The issue is when I change the render criteria to true and ...
-1
votes
1answer
33 views

How to Calculate a Percent in an AggregateResult Method

I am using a custom controller for a Visualforce page on a custom object (Quote__c). I have an AggregateResult method that sums 3 amount fields to show grand totals on my VF page. I would like to add ...
0
votes
1answer
36 views

AggregateResult Grand Total on VF Page

I have a custom VF controller that uses the AggregateResult method to summarize some fields by year. All that works as expected, but now I want to also pull the total for each metric field for all ...
0
votes
0answers
12 views

Visualforce Page Not Available for Custom Button [duplicate]

I am trying to create a custom List button that will sit on the related list of my Quote__c object at the Opportunity level. I created a VF page and custom controller, but when I create the list ...
0
votes
1answer
27 views

Custom Save button in Apex Controller not working

I have attempted to build a custom Save method for a visualforce page I created, but when I click Save, the page reloads with nothing happening. What have I done wrong? :/ Here is my controller code: ...
0
votes
0answers
45 views

Pass value from one VF component controller to another VF component controller within same VF page without side-effects

I wonder how to pass value from one VF component to another VF component within same VF page. I think that Passing VF Page controller to component and set it as parentController in component Apex ...
0
votes
1answer
39 views

Group products by family [duplicate]

Updated I've updated the question because it was not clear and some of you gave me hints.What i originally want to achieve is the following example on visualforce page I want them to be grouped and ...
1
vote
2answers
91 views

Visualforce page can't find my method?

Firstly, let me apologize in advance for my extreme naivete' in this matter. I'm quite new to VF and could not find documentation to cover what should be an incredibly simply issue. I have a quick ...
0
votes
0answers
33 views

Null Value for record after getting id from a map of ids and accounts

The system.debug shows that the id for TempAcct is associated with the correct id after a.get('Franchise__c'), but NewAcct = null. The debug shows that the id was mapped correctly to filterIds, and it'...
0
votes
1answer
38 views

Javascript Filter In Custom Controller Not Returning Filtered Results to Visualforce Page

I have a custom controller and page with a few lines of Javascript. The functionality should work as follows: when a user enters a state or account name in the parameters, the list of accounts and ...
0
votes
1answer
39 views

Filter for Aggregated List Results in Custom Controller

I have a custom controller with a Visualforce page that displays a list of accounts with aggregated results for each account. I want to create a filter for state and inspection date that would filter ...
0
votes
0answers
16 views

List not showing when using same controller for two visualforce pages

I am working on a lookup like functionality where you insert some text in input text box and after clicking search button a popup page is opened which shows list of accounts starting with name entered ...
1
vote
2answers
42 views

IF clause in VF page to render PDF

Below is my VF code, I need to render my PDF only if status__C = approved. How to achieve it. I'm new to development <apex:page controller="MyController" renderAs="pdf" applyBodyTag="false"> &...
2
votes
1answer
163 views

format .cls file in Visual Studio Code

What extension can be used in Visual Studio Code to format .cls files?
0
votes
1answer
35 views

how to display my field values in VF PDF from controller class for a custom object

my VF code <apex:page controller="MyController" renderAs="pdf" applyBodyTag="false"> <head> <style> body { font-family: 'Arial Unicode MS'; } @page{ size: letter; margin:10%...
1
vote
1answer
21 views

Is it possible to grab buttons on record page from Apex to parse button URL merge fields?

We are letting users select certain buttons that contain a URL in our application. That button now accepts merge fields. Handling '{!Object.field}' and '{!$User.field}' and '{!Today()}', and '{!Now()}'...
0
votes
2answers
43 views

Custom controller won't work in component?

I have a custom controller that i know functions as i want it to. I say this because i can use {!var} on a visual force page and i get that value i want. However when i do the same thing in a ...
2
votes
0answers
46 views

Basic Lightning component audio player [duplicate]

I'm trying to get a hold of the Saleforce stack and so far i have created a custom controller and have access to the data i need on a visual force page. However i'm not sure how to translate this to a ...
0
votes
1answer
57 views

Record changed data is not sending from VF page to controller in case JQuery Pagination

VF page displays the records using page block table. I'm updating the records from VF page by clicking on "Save" Button. I've used standard Jquery pagination to implement the pagination. When I am ...
0
votes
0answers
29 views

Can´t see fields to edit in apex:inputFields

I have problem with writing values to custom object in VF controller whitch i include to apex:page. I can´t see box to write values in my apex:form. I have apex:inputfield, but i can only see it´s ...
0
votes
1answer
18 views

Duplicate Management Soql not finding a duplicate that displays on contact's related list

We just activated Salesforce's native duplicate management on an existing org. The users are still in classic, so in order to make it really noticeable that there is a duplicate, I'm creating a vf ...
1
vote
1answer
89 views

How to insert/create a record in custom object using custom controller

While saving the vf page I am getting this error:Invalid character in identifier: getUsers__c.How to resolve this? VF page: <apex:page controller="createUsers"> <apex:sectionHeader title="...
0
votes
1answer
39 views

Unable to update existing lead from force.com site [duplicate]

I have a requirement where I need to update an existing Contact in Salesforce from a Visualforce page on display of a Force.com site. How can this be achieved, since there is no update permission on ...
0
votes
2answers
226 views

How to repeatedly poll a server-side controller for an action in a Lightning Component?

There's a Lightning Component with a button. Its onClick attribute points to a client-side controller's function. It invokes helper's function which I would like to start a polling routine to a server-...
2
votes
1answer
67 views

apex - remove item from dynamic list

The regular Salesforce community sent me here to ask these questions. I'm pretty new to apex and controllers so I'm not sure if I Googled it correctly so please be gentle if this is a super obvious ...
0
votes
1answer
36 views

Visualforce page not returning values

I have created a visualforce page and custom controller. I am trying to create a list of opportunities on Account where the opportunities are related to the contacts linked to that account however the ...
3
votes
1answer
71 views

Where can I find a documentation of Lightning server-side controller's response?

Having a lightning controller's code: var action = cmp.get("myAction"); action.setCallback(this, function(response) { // Callback code's here }); $A.enqueueAction(action); I call for a server-...
0
votes
1answer
14 views

Visualforce page “clobbered” by Visualforce email template

So I've run into a bit of a crazy issue that may or may not qualify as a bug. But it's really weird. I haven't had the time to put together a minimal example but I will describe it here, anonymized. ...
0
votes
1answer
82 views

Records Wrongly Deleted By Javascript Remoting

Below is the code snippet of the VF Page: <apex:page controller="UploadPageController"> <html> <head> <script type="text/javascript"> if (window.File && window....
1
vote
2answers
418 views

Add onClick javascript “custom button” in visualforce page [closed]

I have a custom button created in the object called Account and this button execute javascript, content source is onclick javascript: Name of the button is Viewdetails and "ViewPage" here is a VF page....
1
vote
1answer
25 views

navigating from a UserID to UserRoleId in a custom controller

I've been stumped for awhile on this issue, although I believe there should be something very simple I can do! I am building a custom controller for a Visualforce page and one function I am building ...
1
vote
0answers
90 views

How do I pass the information from the apex:inputCheckbox to the controller using SLDS?

I have a VF page where you select some states. This is working but wanted to make the checkboxes using SLDS Here is my controller code snippet: public string superawesome; public String[] ...
0
votes
0answers
240 views

Code Coverage for Custom Controller Approval Process Test Class

I need assistance with code coverage for below test class. The below codes are the Visualforce component, Apex class, and test class. Thank you for your help! Visualforce Component: <apex:...
0
votes
2answers
717 views

<apex:actionSupport> not calling controller method

I have the following VisualForce code. I want it to call a controller method each time a different option is selected. <apex:actionRegion > <apex:selectList value="{!selectedOption}" size="...
0
votes
1answer
87 views

Test controller cover only 10% [closed]

i'm trying to do a test class for my controller... but cover only 10% controller: public with sharing class CheckInController { // Geo location: longitude and latitude public String ...
-1
votes
1answer
52 views

Unexpected token FROM controller

I have the following controller and I am getting this error: Unexpected token FROM on line 7 and 18. Can anyone help me to fix this. public with sharing class TestMyPropertyController { @AuraEnabled ...
0
votes
1answer
737 views

Redirect to detail page lightning page

Ik have found this example of a controller directing to the account detailpage lightning component of account which works. I am trying to reproduce this for a custom component but my links shows /s/...
2
votes
1answer
64 views

Apex Form to collect mutiple values and run query

I currently have a VF page and custom controller that collects name and email and searches for contacts that match the email, if it finds 1 contact, it 'registers' that contact for our training course....
1
vote
1answer
291 views

Difficulty creating test class on custom controller for table VF page that lists records from custom object

i've spent nearly 2 days looking up how to write a test class and so I thought i'd now ask (works great in staging) I have a custom controller that pulls records from a custom object, and then ...
3
votes
1answer
4k views

Displaying an error message on a visualforce page

So I'm trying to display an error message on a visualforce page using ApexPages.addMessage or ApexPages.addMessages As suggested in numerous threads and posts like this one: https://www....
0
votes
1answer
263 views

@RemoteAction not calling Continuation Pattern response method

We have a VF page where using @RemoteAction calling the controller method. First time using Continuation pattern so not that much familiar. Here trying to call Continuation Request method from my ...
0
votes
1answer
409 views

How to update Child Records based on Parent Record in Apex Controller

I am writing an inline visualforce page to update parent records and their child records. I am making an inline visualforce page where users can edit and update records from parent and child objects ...
1
vote
1answer
107 views

How can I update Child records from list of Parent Records in custom controller?

I have a custom controller with a list of parent records (opportunities) and a list of their child records (opportunitylineitems). I want to save both the parent fields and child fields with one ...