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
23 views

How to pass an array into an Apex Controller

How to pass the array value from the form to an apex controller?.. Meaning this form gonna display 2 or more times depend on the product quantity.. But the problem is that I need to pass the values to ...
1
vote
1answer
15 views

inputcheckbox and inputhidden combination not working

I have a Visualforce page with apex pageblock table and I need the data from two input columns every time user clicks on delete selected button. The input data from the column "checkboxColumn" is ...
1
vote
2answers
39 views

Error When displaying Visualforce page in custom object

I am trying to put visualforce page on a custom object's standard page layout. I want to display all the courses that have been assigned to the student. I have three custom objects Student, ...
1
vote
1answer
37 views

Create Visualforce Page with dependent multi-select picklist

I am new to Salesforce and trying to make a new VF page. I have three custom objects: Students (list of students) Course Details (course time, start date, room, etc.) Student Course Detail Junction ...
-1
votes
0answers
17 views

How to define ActionRegion for more than one inputField?

I have the below code: <apex:page standardController="Opportunity" extensions="OpportunityProductEntryExtension" action="{!priceBookCheck}" > <apex:includeScript ...
0
votes
1answer
22 views

Visualforce id error

Hi Please find the below code where it is used to add multiple attachments at a time for a custom object .I am not able to add id of the custom object record. we have created a custom button by using ...
0
votes
1answer
18 views

NullPointer Exception at Boolean value assign

Please find below class where I get Null Pointer Exception while assigning value to boolean. Please let me know where is my fault here? Thanks! Apex Class: public class CallReplica_controller { ...
0
votes
1answer
20 views

Compare number of elements in Set & List

How to compare whether number of elements in a List & a set is same or not? Can someone please let me know? Not getting it for set directly except traversing in a for loop.
0
votes
1answer
24 views

Using getSelected() method of StandardSetController class

I am new to salesforce. My purpose is to display all the values of the selected checkboxes on one page, to the pther VF page. I studied that this can be done by getSelected() method. But I am unable ...
2
votes
2answers
26 views

pass javascript object into actionfunction reads null in apex controller

I need some help deserializing a json string that I have pass from an action funciton. This is my javascript function something(){ //SOME CODE var actDetails = { Client__c: clidLong, ...
0
votes
3answers
24 views

Avoid duplicates entry in the List - Visualforce page controller

When the user clicks on the checkbox I'm adding that particular item i the selectedContacts list the below code works but the problem with that it clears everytime, if i comment the clear line then ...
0
votes
1answer
11 views

Problem with standard set controller: You have uncommitted work pending

I have a component which makes a webservice callout and this runs successfully in a standalone context - ie within a test page. However the component needs to go within a page that uses the standard ...
3
votes
1answer
109 views

For loop run just once

I have seven different recordtypes, but it seems that the first "for" (FOR (RecordType RType : RTypeList) loop run just once. The debug log show that the sql find 7 rows. 09:22:47.089 ...
1
vote
1answer
38 views

Help with Test Class

When you have a trigger or a class to write unit test for, one would setup the data structure and then execute your code against the data by insert or calling the class between Test.start() and ...
1
vote
0answers
28 views

Visual force Page to search account by Name and should be able to select number of records as part of result

User wants to search Account records by Name and User should be able to select number of records as part of result If user selects Page Size 2 then System should retrieve only 2 account records. User ...
3
votes
2answers
43 views

Got problem on SelectOptions on Multiple Products

I got products. public List<ProntoEVents_Product__c> getProducts() { if(products == null) { products = [SELECT Id, Name, ProntoEvents_Product_Name__c, End_Date__c, Price__c, ...
2
votes
1answer
18 views

Return Chatter Post Date/Time in VF Page

I am returning the latest Chatter post (body and CreatedDate) for a record into a VF page. This is working great when there has been on a Chatter post on the record. However, I am having a slight ...
0
votes
0answers
22 views

Controller to update SFDC Record onload?

I've got a Site.com that I've created to house a VF Page. In this VF Page I am grabbing (using javascript) the ID of a record I am passing in from a hyperlink. Currently, it is simply 'showing' me ...
-4
votes
2answers
44 views

How to write test class for this custom controller?

<apex:page controller="myController" tabStyle="Account"> <apex:form> <apex:pageBlock title="Congratulations {!$User.FirstName}"> You belong to Account Name: <apex:inputField ...
4
votes
1answer
25 views

System.Assert Failing in VF Controller Test Class

I'm attempting to run a test class for a custom Visualforce controller but am having an issue with my System.AssertEquals method. Controller: public without sharing class CC_LegalController { ...
1
vote
2answers
35 views

Test Class for HTTP Callout getting Zero Code Coverage

I'm trying to write a test class for my HttpCallout. The code is working, but I'm having trouble with the test class. I've tried to use the MockHTTPResponse, but I'm still getting zero code coverage. ...
2
votes
1answer
19 views

Attachments are not displayed in a Pageblock Table

I have a visualforce page that will display the attachments from A custom Object based on the Current logged in Portal user AccountID and ContactID. The custom object is Child(LookUp Rel) of Account ...
0
votes
1answer
20 views

First Test Class - static data

I'm completely new to Apex, and self-teaching a lot through examples. I just completed [with this community's help!] a custom VF page with "industry news" twitter feeds. It's a basic page, with each ...
3
votes
0answers
35 views

Save & New Button for Visualforce page with data on lookup

public class ProductController { ApexPages.standardController m_sc = null; public ProductController(ApexPages.StandardController sc) { m_sc = sc; } public Pagereference ...
0
votes
0answers
39 views

Redirect the page to external website with Post values from Visualforce page & APEX controller

i have one Application in salesforce. it is passing parameters in URL querystring form. I want to avoid passing params in this form, it may have sensitive data. Question How to redirect the page to ...
2
votes
1answer
54 views

Account Id is not passing from Visualforce page to controller to display child object - this is useful to build a nested table as well

Can anyone help me to get account id from Visualforce page to controller , here is my code we can get id - i am editing it . Vf Page: <apex:page Controller="accsearchconroller" sidebar="false" ...
0
votes
2answers
33 views

How overriding works in standard/custom controllers?

1) If I have a standard controller and two extensions Ext1 and Ext2 and if both Ext1 and Ext2 have the save method, then whose save method will be called Standard controller's, Ext1's or Ext2's? ...
1
vote
0answers
30 views

Image doesn't display when I changed the Image name into dynamic

VF Page <apex:page controller="ImageController" showheader="false" sidebar="false"> <apex:form> <apex:image url="{!imageURL}"> </apex:image></apex:form> ...
3
votes
1answer
33 views

Update Record from Visualforce Checkbox

I'm displaying a checkbox and a button on a Visualforce page. Upon clicking on the button, I want a checkbox field on a record (the current user's User record) to be updated with the value in the ...
0
votes
0answers
42 views

Community Self-Registration Error with Custom Field

I am having issues passing through the VFP & Controller a Custom Field. Mimicing the process for Standard Fields, I can pass anything through without an issue. Visualforce Code: <apex:page ...
1
vote
0answers
30 views

Read Access Denied For Visual Force Page

I'm trying to display a table of object permissions. However, when I try to connect my controller with my visualforce page, I'm am receiving a "Read access denied for ObjectPermissions." ...
0
votes
0answers
22 views

VF charts rerender issue

I have showing chart on VF Page in output panel. Its working fine if I start the page the first time, but when I rerender the panel the chart goes blank. I don't know why. Please help. I tried a lot, ...
1
vote
0answers
15 views

Service invokation pattern [closed]

I often need to call many external SOAP based services from controller. Is there a best practice framework / design pattern we can follow to manage code better.
1
vote
1answer
24 views

How to use a loop to query a Product2 list from a QuoteLineItem list?

I have no idea why this isn't working, some help would be greatly apprectiated! Here is my loop: for(integer i = 0; i < myQuote.LineItemCount; i++) { prod.add([select id from Product2 ...
1
vote
1answer
33 views

How to access set Collection of Wrapper class in apex PageblockTable

Controller: public with sharing class ControllerExtension { public Set<WrapperOppLineItem> shoppingCartSet { get; set; } public class WrapperOppLineItem{ ...
1
vote
3answers
78 views

Updating the picklist values in VisualForce/apex controller

Is it possible to have two control fields for a picklist field?Can we achieve it by Visualforce? I have three fields.Sold (Checkbox), Onsite (Picklist) and FlagStatus(Picklist). If Sold field is ...
1
vote
1answer
61 views

How to disable input text without loosing its value when page is reloaded due to validation failure

I have a apex:inputText field which is disable in following 2 ways 1. <apex:inputText Id="pBSId" value="{!pBSId}" disabled="true"/> <apex:image value="/s.gif" ...
1
vote
1answer
43 views

Test Class is referencing wrong Apex Class [closed]

So I wrote a Test Class (for Controller) but on running it is throwing an error for a different Apex class(on Quote) that I've not written, my Apex Class: public with sharing class ctrlname{ ...
1
vote
2answers
71 views

Hiding input field

I want to hide the below bold input fields. Is there any easy way i can do it. I tried using style="display:none;" but it does not work. Thanks <apex:pageBlockSection title="Section 9: Optional ...
1
vote
2answers
38 views

Need help in understanding partner portal in this particular org

I am trying to understand how the partner portal setup is working in my organization. My sincere apologies if this question is inappropriate for this forum? Here is how the partner portal setup is ...
1
vote
2answers
30 views

Test Custom Controller attached to VF Component

I am trying to write a apex test class for the following Custom Controller and am just having a tough time getting it covered over 37%. Please Help! See my code below. Thanks in advance! I am ...
1
vote
1answer
23 views

Passing value or linkinginput pick list

I made a 3 page site using visual force. In my 1st page, it has input controlling field called System Size (Product_Brief__c.System_Size_SUB_2013__c). In my second page I have input field called ...
6
votes
1answer
125 views

Order of execution of controller method calls during rerender

Let's say we have an apex:commandButton, with immediate="false", and no apex:actionSupport. It's just a standard apex:commandButton inside an apex:form. Additionally, suppose it has a reRender ...
0
votes
1answer
19 views

How to save edits on a custom visual force page on a related object

I have a visual force page where the standard controller is the Case object and it has a related object. I need to save edits made to the related object, but there doesn't seem to be a straight ...
1
vote
1answer
61 views

ApexPages.currentPage().getParameters with javascript remoting

I am working with a VF page that uses javascript remoting to do some work that an earlier developer made. There won't be an easy way to move the remoted method into the controller as a normal method ...
2
votes
2answers
37 views

Controller method doesn't load with custom component and email template

I develop an email template which calls a Visualforce component with a custom controller (controller of the custom component). I give an opportunity Id to my custom component and I would like load ...
0
votes
2answers
57 views

Update checkbox on parent when any of it's child records are updated deleted , parent change

I have 2 objects Opportunity(Parent) and Bigmachines (child), i have check box field (flagPhyscianProctor__c) on both the objects so when this check box is checked on any of it's child records then ...
0
votes
0answers
41 views

Passing a dynamic variable to an Apex controller on page load

I have a controller which runs a dynamic SOQL query when it instantiates and makes the results of the query available to the VF Page to access. I use this controller with several VF pages and pass a ...
0
votes
2answers
46 views

Delete a record and insert it again - Apex Controller

I have a situation, where in a record if Name__c field is updated, delete the record, and insert a new one with Status__c = In Progress. Also when inserting the new record, all the values of the other ...
0
votes
1answer
28 views

visualforce page with parameters in Unit Test

I cannot understand whats going wrong in this unit test. Last assert is failing: array is out of bonds. Thats a fragment from test class: static testMethod void testRemoveContact() { ...