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

2
votes
1answer
45 views

Visualforce Page and standardController attribute in Apex Page

I am developing a Visualforce page which will be rendered when a Salesforce User arrives by clicking a specific Account. The Apex page looks something like this: <apex:page> ...
2
votes
2answers
28 views

Problem with using a variable in a controller from a Visualforce page

My problem is as follows: I've got a Site VF page with fields bound to a custom Lead object. One of these fields is a id field that's used for contact lookup. The controller seems to work fine but ...
1
vote
1answer
29 views

Using MVC architecture. Visualforce page unable to get list column from Model

I created an MVC software architecture. Here's the breakdown: M= Model_Enter_Discount V=Page_Enter_Discount C=Controller_Enter_Discount. On my Model_Enter_Discount page, I have created the following ...
0
votes
1answer
25 views

Validation for decimal field to restrict blank values and string values in visual force page

I have a visual force page in which I have a field to accept decimal values. I can restrict the user from entering 0.0 and null values, but I cant do the same for '' (Empty String). Is there any ...
0
votes
1answer
13 views

fetching data from model and want to show only 2/3 data per page and through command link want to go next page and show another data

I have few data in sobject model. i want to fetch those data and show only 2/3 data per page and there is below one command link is there through I want to go to next page and show another data. how ...
1
vote
2answers
35 views

Custom form not saved

Iam a newbe to APEX and I have the following form and Controller <apex:page controller="AddLinesController"> <apex:pageBlock > <apex:pageMessages /> <apex:form > ...
0
votes
0answers
12 views

How do I extend a standard Account Controller with a PageReference Class with a POST method for SSO credential passing?

I have the VF page and original class I will use to model the controller extension after. How do I extend the Account standard controller with a PageReference class with SSO parameters?
2
votes
1answer
64 views

Creating Salesforce Person Accounts via Visualforce

I have recently activated and configured Person Accounts in our salesforce org. We will be using these within the service console and also integrating Postcode Anywhere for address lookups. To ...
-1
votes
2answers
68 views

How to get the text fields values in the controller class without using any scripts

Im having a VF page it has some text fields and one button . On clicking the button , the values in the text field should be passed to the controller class to save in the database . Can this be ...
0
votes
2answers
21 views

Schedule VisualForce Extension and Actions

I'm getting out of my league with this little project so sorry if off base here. We have a custom button on a custom object page. Button calls VF page as listed below. Trying to see if we can easily ...
2
votes
1answer
137 views

CheckALL doesn't visually show all checkboxes as checked in Visualforce

I implemented a checkbox class with a checkaLL function(called using javascript) which makes sure to select All checkboxes as it should. However, the problem is that it doesn't visually show the ...
0
votes
1answer
72 views

How do I deploy an APEX class from one sandbox to another successfully?

I had to make a few updates to an APEX class in my development sandbox. I edited the class from the develop, apex classes menu in Salesforce, and then saved. I tested the class but am receiving the ...
0
votes
1answer
58 views

What do these lines on a controller extension mean?

I'm trying to build a test class for a controller extension on a Visualforce page and I need a more in depth description of what certain lines mean. Help on this would be appreciated. 1) String ...
2
votes
3answers
115 views

How to access outer class instance variables from inner class in controller?

I have an outer class with an inner class as part of a controller. I have tried setting the instance variables in the outer class as static, which allows the code to compile, but after the controller ...
1
vote
2answers
83 views

New Tab for PageReference

I want to open my Vf page on new tab please guide me what i need to do to get the process done my code : public PageReference totalbookedClick(){ date myDate = date.today(); integer ...
1
vote
1answer
78 views

Avoid SOQL 100 error by querying outside of the loop

I'm currently running a program which limits a query to 95 items in order to avoid the SOQL 100 queries error. THe relevant snippet of the program looks like this: while(x!=0){ ...
1
vote
1answer
139 views

How do you access a wrapper class from a Test class?

I have a VisualForce page which uses a controller. Within the controller I have a couple of wrapper classes which hold various form elements on the page. Everything works great, but now it is time ...
3
votes
3answers
68 views

Controlling Access to Force.com Site

Is there a way to control who access the force.com site externally besides using IP addresses? I tried using a profile checker: public static String ProfileCheck(){ String ReturnVal; Profile Pro; ...
3
votes
1answer
77 views

Unauthorized Page Redirect in Controller

I am trying to create a small authentication on my force.com site so that I don't have any random person accessing the site/visualforce page unless they are currently logged into Salesforce. Also if ...
1
vote
2answers
140 views

Creating a list button for a task

My goal is to create a btn on a task related list that launches a visualforce page and does a redirect. I tried using a StandardSetController, but Error: List controllers are not supported for Task ...
0
votes
1answer
103 views

Can you create mutilple columns of data from one controller in VisualForce?

I am trying to create a VF page with multiple columns of data from one controller. Here is the page so far:. What I need is for each of the Management Types to have it's own column and show all of ...
3
votes
2answers
196 views

Visual Force lookup Filter

I have a custom visual force page that let you create a new custom object. In this page there i have a custom lookup to choose the contact. Do you know if it's possible add a Filter condition to the ...
2
votes
3answers
518 views

Passing apex:inputField user entry as parameter into Command Link

I am getting the nickname from an inputField and updating a list of strings and displaying the list of strings on a table. The outputField displays the newly entered value, but the controller variable ...
3
votes
1answer
782 views

Removing rows separately from the Visualforce pageBlockTable list

I created a visualforce page (with controller) that allows adding multiple records to a custom object (master object is account). I can add new rows and save the new records, I'm also pulling ...
0
votes
0answers
25 views

Correct way to override save action in controller extensions [duplicate]

Is it ok to call standardController.save(); in a controller extension or should one always just do the custom stuff and then do a DML like upsert record; I have the feeling that calling the ...
9
votes
3answers
307 views

Knowing if a future call is allowed

I'm having an issue where we have some code that can be called anywhere and then it makes an @future call to log a message to an external system. The problem is if this method is called (either ...
10
votes
1answer
110 views

Difference between returning null and ApexPages.currentPage()

How is returning null different from returning ApexPages.currentPage() as a result of a controller action?
4
votes
1answer
113 views

DML not allowed in page action when nothing happens in constructor

This question may similar to DML not allowed in page action but I can't resolve it. This is my page: <apex:page Controller="MyController" action="/{!MyAction}"> Page loading... ...
3
votes
2answers
54 views

How to ensure something only happens once in a request?

If I have a page which include multiple components which means that multiple back end controllers get invoked on page load. How do I ensure that a piece of business functionality only happens once? ...
5
votes
1answer
93 views

Lifecycle of Controllers

I am just wondering about the life cycle of page controllers? How often are than instantiated and is there any configurations which can change this? Is there a method guaranteed to be invoked every ...
1
vote
1answer
98 views

Calling a dml statement in a constructor of a controller

I understand that we cannot have dml statement in controllers constructor. But in my case, i have a query string which is used to run our pages. So my code reads the querystring variable in the ...
2
votes
4answers
93 views

Ensuring a all controllers invoke a method

I want to apply this fix to an IE 10 problem. The thing is you could argue this fix should be applied to all controllers. I was thinking of having a base controller putting it in that and then all ...
-1
votes
2answers
116 views

Value of variable set after the constructor completes its execution [duplicate]

Here is the situation: I am passing a value from my component to its controller <apex:component controller="MyController"> <apex:attribute name="someObj" assignTo="{!receivedObject}" ...
0
votes
1answer
172 views

Custom Controller Case Attachment

I'm new to SF and trying to write a custom case controller that adds an attachment to a case. I've simplified my apex code below. I'm guessing I need to do a.OwnerId = UserInfo.getUserId(); to get ...
4
votes
1answer
133 views

Subtotal vs Aggregate Function

I have created a custom object Commission_Rec__c with a master/detail relationship with a custom child object of Order_Entry__c. What I am trying to do is create a vf page that will display ...
1
vote
1answer
67 views

How to set a value at runtime in a visual component on a component controller?

I have an interesting problem. I have a visual force component where i am looping through a list of data objects say MenuItem data object for now. Now i populate this list on a property in the visual ...
0
votes
1answer
339 views

get set to apex:selectOption

I am trying to set a value from my controller to my apex:selectOption value. I have created a get set method and the value in the get set have been changed but no change at all in apex:selectOption. ...
0
votes
1answer
150 views

Custom New Button that creates record of specific type and parent record in Visualforce Controller (No URLFOR!)

Sorry for the lengthy title. But I want to make sure that I was not able to solve my problem with the standard answers to questions like this. I have a CustomObject_c that has many record types and a ...
4
votes
2answers
235 views

Debug ViewState Problems in Force.com Sites VF Pages

We're implementing a complex web application based on force.com Sites and ran into problems with the ViewState size of one of our pages. Now on the platform I would activate Development Mode and the ...
3
votes
4answers
1k views

restful call to external analytics API via visualforce/apex

So I'm trying to access Woopra analytic's restful API via apex/visualforce. I am wondering a couple of things: 1) The API returns a JSON object via the usual POST/GET method... would it be best to ...
1
vote
2answers
110 views

referencing an object in a map in visualforce

So, given the following controller snippet and VF page snippet... public Map<String, Region__c> divisionaddresses {get; set;} public List<String> allDivisions {get; set;} public ...
1
vote
3answers
194 views

System Null Pointer Exception: debug help

So I have the following controller: List<User> users {get; set;} public reshapeUserDivisions() { users = new List<User>(); users = [SELECT Id, Division, FROM User WHERE ...
3
votes
1answer
229 views

how to make a list persist in a controller on page redirect

I have the following search function: public List<User> SearchResults {get; set;} public ContactSearchController() { if(SearchResults == null) { ...
2
votes
5answers
2k views

displaying a Map<String, Map<String, Object>> in visualforce page

so, say I have the following map: public Map<String1, Map<String2, Object>> objectMap {get; set;} public List<String> ListofString1Entries {get; set;} public List<String> ...
6
votes
2answers
178 views

How to pass session state between multiple custom controllers

I have a 65 multi step wizard form where i need to collect data on each step and have a previous and next button on each page. I have to store the data on each page and finally at the end store all ...
6
votes
1answer
143 views

How can I change the HTTP status code on a Visualforce Page?

I'm trying to develop a Page that given some GET parameters would return HTTP Status 200 or status 400 depending on some inner query. This would be really easy with a RESTful service, but we need ...
0
votes
1answer
88 views

object Name being replaced with object ID

So, the relevant snippets of code are: function doFunction(choice) { switch (choice) { case "changename": ...
5
votes
1answer
92 views

Is there away to pull a users standard layout in edit mode and place it on a VF page?

I know there's a ways to do this using tag to view the detail page, but once you hit edit it will use salesforce standard edit page. I've also created a custom edit page but the problem I'm running ...
3
votes
1answer
83 views

Render a tab for certain public groups

I have a custom page that overrides the default account page, dividing it into multiple tabs. I was wondering if there was a way to use the "rendered="{!IF($.........." to make the tab available to ...
0
votes
1answer
50 views

partition a table of Contacts based on a field value in VisualForce page

So, Say I have the following visualforce page: <table width="100%" border="0"> <tr> <td valign="top"> <apex:pageBlock mode="edit" id="results"> ...

1 2