A controller is one piece in the Model-View-Controller (MVC) architecture of Visualforce. A controller can be a standard or custom controller and extensions to controllers can written.

learn more… | top users | synonyms

1
vote
1answer
16 views

Call variable from extension with JavaScript

This is my controller: public with sharing class MyController { public myObject__c myObj {get; set;} public String myObjectId; public Boolean one; public Boolean two; public ...
1
vote
0answers
32 views

CurrentPage getParameters() is empty the first time I post to a page

I have a VisualForce/APEX page that I am posting to through a form. I send over a list of contacts as a single string. When I get to the other page I use the following code to retrieve the post ...
2
votes
1answer
21 views

Visualforce how to onSubmit via controller return error or true

I currently have a Visualforce page where a User can tick selection boxes in order to edit multiple License Voucher # Object fields as shown below. I would like to perform a field check for empty ...
1
vote
2answers
23 views

Invalid type: ConnectApi.User​​GroupPage

I'm working on a Visualforce page where I want to grab a user's groups and paginate over the list. Getting the groups is pretty straightforward using the ConnectApi's ChatterUsers.getGroups method ...
0
votes
0answers
20 views

Insert Image Blob data into salesforce as an attachment using apex contoller [duplicate]

I need to insert a image into salesforce using apex controller . I am getting Blob data from javascript to apex controller. Now i stuck up in inserting the image into attachments. I found that the ...
0
votes
1answer
21 views

Want to upsert Attachment base on parentId

There is no external id column for Attachment object, but the requirement is to insert Attachment for the parentId if there is no attachment present else use the already existing one. Please suggest ...
1
vote
1answer
24 views

VF inputText field to filter a wrapper list containing custom SObject

I currently have a wrapper list containing custom sObjects and checkboxes. I also have a inputText field on a Visualforce page and would like to filter the wrapper list by License_Voucher__c which is ...
1
vote
1answer
21 views

call dml insert listofSObject from a controller that is referenced in apex page

Is it possible to call dml operations like insert list_SObject ; inside a controller method that is refrenced in visualforce page not some trigger class? please give some references.
1
vote
1answer
50 views

Map<String, List<Sobject>> reference inside apex method

I've a Map getter Map<String,List<Call2_vod__c>> mapProductEntity ; for(Account p: [SELECT Name, (Select call_date_vod__C,signature_vod__c FROM Call2_vod__r from Account WHERE ID IN : ...
0
votes
0answers
17 views

why do we need extension for controllers [duplicate]

I am new to SalesForce , I just learn about Standard controllers ,Controllers and Extension to these controllers. But what I do not get is why we need extension to the controllers ? By that I meant, ...
1
vote
2answers
45 views

String / Date comparisons Custom Fiscal Year

I have custom fiscal year starting May 1st to April 30th. I want to find a clever way to select a picklist value based on opportunity closed date. Picklist values 2010 through 2020 Here is the ...
2
votes
2answers
79 views

Call a method in controller from Component (not in Constructor)-Visualforce

<apex:component> <apex:attribute name="l" description="l" type="double" assignTo="{!Received_L}"/> <apex:attribute name="varLng" description="t" type="double" ...
2
votes
2answers
42 views

Passing a value from a VF Page to Controller

I have been working on this on and off for quite sometime now, and have hit a wall. So what I'm trying to do is pass a Super Customer to my controller where it will get picked up and pushed over to ...
0
votes
1answer
46 views

View State and Heap Size too large

I am trying to execute this Apex code but getting view state size of 196 KB and Heap size error. I tried to find where the bulk of view state is going to and it seems to be this controller. Could ...
0
votes
1answer
19 views

Constructor not invoked for Custom Controller. Any suggestions of what is wrong?

I have built a custom controller and the constructor does not automatically invoked when the page is executed. What could be wrong in this? Am i missing something? The System.debug('Inside ...
-1
votes
0answers
32 views

Save selected choices gets save on another object

I have 3 custom objects- Question, Question Choices and Answers. Lookup has been defined on Question Choices to Question object and another lookup has been defined on Question object to Lead. I want ...
1
vote
1answer
41 views

APEX Unit tests hello world

I am trying to learn how to do APEX testing but all the tests in the documentation are too complex and I can't find an example of a simple APEX Controller that is a Hello World Test. I have this APEX ...
0
votes
1answer
21 views

Page lifecycle reading query parameters and executing

I have a working view and controller. I've added a custom link to accounts/leads that passes the id and type in the query string to an page and here the controller should then load some data according ...
1
vote
1answer
25 views

VF Controller search logic

The following is my controller for my VF page that is going to search for certain Super Customers. On every Account there is a field called Super_Customer1__c, and since Super_Customer1__c will often ...
0
votes
0answers
39 views

Saving Dynamic rows to an Object on checking the checkbox

I have an Order Object , Product and a Junction Object OrderProduct. I have used as inline vf in Order Detail page and I want to capture the Product Details in that Inline VF and then save the Order ...
1
vote
0answers
30 views

Requirement in Visualforce and apex

We have total 9 steps, In step 4 : We have some check box options like A, B, C, D , E, F, G. We have selected A B C D In that we have two fields like unit level (text) and service level (Pick list). ...
3
votes
2answers
195 views

Display header and footer in all PDF pages using VF

My vf page <apex:page renderAs="pdf" Controller="testpdf1"> <head> <style type="text/css" media="print"> @page { size: 8.5in ...
1
vote
2answers
22 views

Calculating Fields in Controller - Better Ways?

Thanks for your eyes on my issue. I'm hoping to get feedback on a better way to approach a solution! Here's my situation: I have a Visualforce page and corresponding controller that looks at a series ...
0
votes
2answers
30 views

VF Controller Test Class

I have been trying to create a test class for my controller for my visual force page and I am not grasping the concepts behind it, can someone help me get started? I have tried a few things but I have ...
1
vote
3answers
70 views

Method does not exist or incorrect signature: [String].getDescribe()

I've checked the other answers and googled alot, cant seem to find the answer to why this doesnt work: public List<SelectOption> AccountIndustryOptions = new List<SelectOption>(); public ...
2
votes
2answers
21 views

how to search a child record based on parent name in sosl

I have a search VF page (it is just like google search with text box). In this i am searching all fields of a object then retrieving records by sosl search (upto this functionality it is working ...
1
vote
1answer
25 views

Share (wizard-like) state between page with controller extension and page with controller

I have a custom VF page to create new or edit records of Type CustomObject__c. Via a Linker__c object such records can be related to other OtherCustomObject__c. To create such links I have a button ...
0
votes
1answer
32 views

Insufficient Privileges error when changing value of picklist

I have picklist of values Lead and Opportunity, By default value of picklist is Lead When I change it to Opportunity and, if change it back to Lead, it gives error of Insufficient Privileges.
0
votes
0answers
63 views

Incorrect code coverage in developer console

I have an apex class called RelationshipTreeController (RTC for short) and a test class called RelationshipTreeControllerTest (RTCT for short). I have written a test method that calls the search() ...
0
votes
0answers
31 views

Visualforce save all records with inline editing, sorting and filtering

I need to build an editable grid of a custom object with sorting and filtering and be able to save all edits. I was able to build the editable grid of the custom object like in this link. Then, to add ...
3
votes
2answers
38 views

Why is my locked record editable?

Why is my record locked? The record that the class below creates, when shown in detail view, has the 'locked' icon, and appears to be locked at first view, but- Why can I edit the locked record (Even ...
4
votes
1answer
116 views

How can I use the html (pass through) attributes in Salesforce

I have create a VF page which is accessible on mobile through which I can take pic and attach it to the selected record. For this I have created a input tag in html <input type="file" ...
0
votes
2answers
55 views

I can't execute a simple batch class in my controller

I was about to use a batch class and now I'm stuck cause It wont execute. I don't know why. Here's the code from my controller class: public ConstructorName(){ dispForecastSummary(); } public ...
0
votes
2answers
29 views

Sorting a list of checkBoxOption Error: One or more of the items in this list is not Comparable

I am attempting to sort a list a list in my class however I am running into the error above. The list comes from a method in another class. public static List< vCtrl.CheckboxOption> ...
0
votes
0answers
36 views

can we update the related list object data with standard controller as master object?

I have two objects quote and quotelineitem master is quote and related to quote line item quote---->quote line item Visualforce page : I have kept like this <apex:page ...
0
votes
0answers
12 views

when downloading last page of results not getting downloading here i am using Pagination Concept in VFpage

do{ for(Inv__c ip:(List<Inv__C>)EquipCon.getRecords()) { totalInvestList.add(ip); } Equipcon.next(); ...
2
votes
1answer
34 views

What is the use of calling a controller inside an APEX trigger? Is that a best practice?

I saw some posts related to APEX triggers and recently one below, Salesforce method to update doesn't get commited in which the trigger have few lines, ApexPAges.StandardController sc = new ...
1
vote
1answer
35 views

How to write test class for a controller with non dml statements

I have a controller without any dml statements. How can i write test class for the controller to improve the coverage area ? public with sharing class payslipController { public Decimal ...
3
votes
1answer
159 views

Controller Class Inheritance vs Multiple Controller Extensions

From reading the docs and dev forums, it seems that having multiple controller extensions can offer the ability to override methods, and keep class size/structure simple. Because these are things ...
0
votes
1answer
52 views

Custom VisualForce Page/Controller SObject only accessable by creator

I'm having an issue with a custom Page/Controller in that, it is fully operational in production if I (the creator, I'm also a system admin) access it, but to everyone else it displays the error ...
1
vote
2answers
73 views

apex:inputCheckBox selected attribute is not working

i write a small snippet related to apex:inputCheckBox <apex:inputCheckbox onclick="callRemoteFunction(this,{!num})" selected="{!isItemSelected}"/> i am facing error Unknown function ...
0
votes
0answers
32 views

Knowledge Article System.QueryException: List has no rows for assignment to SObject [duplicate]

I'm getting the following error in a knowledge article controller that i'm working on: Article__kav article1 = new Article__kav(); article1 = [select URLName, id, Title,Partners__c,Cisco_Account__c, ...
1
vote
1answer
216 views

Visualforce: Pass inputHidden value to controller variable

I am attempting to use jQuery autocomplete to pass values to my controller. Autocomplete doesn't seem to work with apex:inputField so I am forced to use an html input. The problem is I can't seem to ...
1
vote
1answer
32 views

How to show grand child record names in Pageblock Table

I have 4 objects A,B,C,D Visual force page written on A results showing in Page block table. Relationships: A--->B Master Detail C---> Junction Object for B & D REQ: Need to show D names along ...
1
vote
1answer
83 views

Opportunity Record Type Selection Page

I'm trying to create a visualforce page which clones the record type selection page when creating new Opportunities. I'd like the page to display opp record types based on the related account record ...
5
votes
4answers
272 views

Visualforce Controller Unit Test (VF page displays fullcalendar)

I've written a visualforce page (with the help of examples etc from the internet) to simply display an instance of fullcalendar.js. There's no buttons etc, it simply loads when clicked from the home ...
1
vote
0answers
42 views

Cancel with confirm message requires double click

I have a simple example of a custom controller and a VF page. I have a cancel button on the VF page that shows a confirmation message to save unsaved data before leaving the page. When I click on ...
1
vote
1answer
74 views

Creating the child record based on parent field

Opportunity-->Pif(Child) Opportunity-->Proposal(Child) I have a logic for for single PIF can able to create many propsals. Now Requirement is I have many PIF's and each PIF(PIF_GDS__c) have each ...
1
vote
1answer
52 views

Non editable fields in the runtime, can that somehow be overcome?

I try to do my dynamic filtering on the form based on an object values, entered by a user using apex:inputField. The object stays in memory and never gets inserted to the DB. When I try to assign ...
0
votes
0answers
67 views

apex:param value not getting assignTo the controller

I have create a VF page from where i am trying to pass the value to controller. I have a picklist on which when i change the picklist value i need to send this value to controller. But the changed ...