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

3
votes
0answers
29 views

Internal Server Error in Partner communities when using extension controller

We have a appexchange app in which there is a global class. We are using this global class as controller in local VF page and also created a extension class. When i try to use the variable declared ...
4
votes
2answers
59 views

Test Class SeeAllData=true Annotation

I am creating a test class that will test my controller class which uses almost 5 to 8 objects that has many DML statements like insert and delete, however I am feeling a little bit worried about not ...
0
votes
1answer
23 views

JavaScript executing before controller method finishes

So I have an action function which calls an apex controller method. I call this action function within some javascript at the top of my page and after that call I want to send some information to ...
1
vote
0answers
29 views

Unable to create an instance of extension {CLASS NAME}

I'm getting this error, i'm sure I what this means. I couldn't find anything helpful anywhere.
1
vote
1answer
23 views

Checking if object exists on controller

I'm trying to handle the edge case where a user hits my page without the Id being set for whatever reason. However, I'm having problems detecting when no object is loaded. I tried this: private ...
2
votes
1answer
58 views

How does one test Visualforce components with custom controllers

I have created a custom Visualforce component. It is backed by a custom controller. I am struggling to write unit tests for it. The limited VisualForce documentation indicates that to test it I ...
2
votes
1answer
28 views

Accessing Controller Property from VF page

I have a Controller property that displays the record type name of a Case. I just need to display the record type during Case Creation or Editing. This should be a read only as such I decided to use ...
1
vote
2answers
22 views

Expression cannot be assigned at line

How could I assign a value to a dynamic query field? I want to make an update of a record. ac.get(campo) = totalAcumulado.get((String)ac.Name); <-- Expression cannot be assigned at line This ...
5
votes
2answers
112 views

What controls the 'severity' of ApexPages.addMessages(exception)?

I'm trying to crystallize out some 'best practises' for Visualforce Page exception handling. I think, at a minimum, a page should look something like this: <apex:page ...
2
votes
1answer
38 views

What is the difference between initializing properties in shorthand vs constructor?

I thought these two samples would be functionally equivalent. But they behave differently: Initializing a property in the constructor: public with sharing class LeadController { public ...
1
vote
1answer
63 views

Uncheck checkbox using javascript after JS onload

I am pasting a complete code for anyone reference if they like to resolve it.(Just incase they want to know what i could be missing.) NOTE: CaseOwnerChanged__c = Checkbox field type <apex:page ...
1
vote
2answers
43 views

Accessing the fields of Database.query() results

Database.query(query) returns sobjects. I want to access each fields in this sobject to check the value on each field. How is this done in controller?
1
vote
1answer
26 views

Combine multiple PDF's together and attach them in a mail?

As of now , all i have is a VF page which renders as a PDF and it needs Account ID to be passed to generate a PDF . Is there a way wherein i can group all the PDF's into a single PDF ? Should i change ...
2
votes
2answers
34 views

Inline vf page to Related Section

Is there any way to put inline visual force page to related list section of case object?As per my understanding we can create new section above the related lists and we can put over there..but i ...
0
votes
2answers
93 views

passing data from Page controller to component Controller

I want to pass list of record from VF page controller to component controller but when i access variable in component controller using object creation then i am getting null value. I am taking Example ...
0
votes
0answers
39 views

Sorting Aggregate Results VF Page

working with VF Page page block table and attempting to display count of "sales" broken up by different carrier buckets. In my SOQL Query, I am able to easily get the rep's name and total number of ...
0
votes
2answers
46 views

Test class for new case controller

I've recently been writing a few basic controllers for some visual force pages, and of course now need to test them. Problem is I don't really know how. Normally you know you'd instantiate the class, ...
5
votes
1answer
81 views

JavaScript Remoting and optimal Angular.js architecture

Background I am starting to build more and more apps with angular, inside of a Visualforce container. Since many of the database services rely on some apex logic, the services layer uses JavaScript ...
1
vote
1answer
62 views

Need to Filter a VF page with date input and pass to SOQL statement in controller

I have been working on this for a few weeks now so any assistance would be wonderful. I am trying to create a report with a VF page to pull information from some custom objects and their associated ...
1
vote
1answer
38 views

Controller to place opportunity products related list on case page layout

I am trying to create a controller to view opportunity line items on a case that is related to an opportunity. I am not a developer, and copying and pasting code. I am currently receiving an error: ...
4
votes
1answer
170 views

Winter 15 preview new error messages: valueOf() function

We have been experiencing serious issues today with the release of Winter 15 into our sandboxes... Salesforce System Error: 1702643372-49547 (938791604) (938791604) Error is in expression ...
0
votes
1answer
74 views

Display message on parent window after closing VF Popup

At the moment I have a button placed on my Opportunities page which opens a popup, on my sendRequest() function this popup is closed. What I would like to do is further improve this function to also ...
3
votes
1answer
48 views

custom controller with extension

What are some use cases in having a custom controller with extensions? Does it make sense to have something like this? EDIT2 Edited out the error I was receiving - apparently in my extension I was ...
0
votes
1answer
32 views

Visualforce tab to track order details

To capture all the order details I built a VF page with an extension to get all the orders details for the current user. Following is the way I tried... public with sharing class Order_Extention{ ...
2
votes
1answer
64 views

Apex properties in helper class

I have an apex helper class named "PricingConversion" called from my apex controller "DeaRowEdit". PricingConversionHelper.CalculationSecondPricingTon(dealrow); I would like to move the properties ...
1
vote
1answer
27 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
42 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
39 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
39 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
21 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
32 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
32 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
23 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
73 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
18 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
73 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
222 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
57 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
72 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
20 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
vote
1answer
69 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
34 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
30 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
59 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
631 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
34 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
52 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
310 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
33 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 ...