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

0
votes
0answers
6 views

Depending Field in List with edit mode

I have a list of all open opportunities and the possibility to edit the list. Also I have the depending field recordtype (product) connected with stagename. If I change the recordtype the picklist of ...
0
votes
1answer
11 views

upon checking checkbox field on parent need to check child records exist or not

I Have a Parent Account object in this i have check box field "No Asset exist". when ever i am trying to check the checkbox it need to show error message if Assert records exist for this Account ...
3
votes
1answer
55 views

setting default value for properties in controller

I was searching on how to set the default value to a select List input on Visualforce and found the below trick: public String selectedReminderTime {get; set;} {selectedReminderTime = '08:00 AM';} ...
1
vote
0answers
31 views

Opportunity RecordType and Sales Process

if I want a picklist with the stagename and the probability I can use the code below. But how can I get a list of recordtypes with the stagenames? Thanks, Sascha Public List <SelectOption> ...
0
votes
0answers
21 views

How to get email template content to Visualforce page

I am redesigning send email landing page on case to meet specific business requirements. My requirement is: - Load default template based on case priority. Subject and rich text editor should be ...
3
votes
2answers
99 views

Get text input value with the help of HTML and pass it to controller

I have designed my VF UI using HTML. I have a doubt, is it possible to get a Value in HTML (Input Type:Text) box and pass it to controller ? Please find the codes below My current VF page ...
1
vote
1answer
19 views

Test class on a class contained by another class

I have to write a test class for an apex class which look like that : public without sharing class HController{ //public user currentuser{get;set;} public Account personContact; ...
0
votes
1answer
21 views

INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call

I can't see why I'm getting this error. I'm using a VF page in the edit mode of a record. I am attempting to create a select list with a query in the controller. When the user chooses something for ...
1
vote
1answer
58 views

Javascript Code is not working!

Whenever I am writing a javascript code to check if the input text is taking an empty value, it doesn't work. Please check what is the problem with my code? Page Code
0
votes
1answer
27 views

how can i get the record in account object dynamically?

I have created controller and vf page.In my controller having three buttons such as modify,save and cancel.when i click the modify button(read only) it display the same page with save and cancel ...
0
votes
1answer
26 views

commandButton onclick actionFunction doesn't execute on controller

I have a command button that calls an actionfunction to reset a password. I then want to alert the user of their new password. In the controller the new password is not being saved. VisualForce: ...
0
votes
1answer
35 views

Passing ID in URL from One VF Page to Lookup Field

I am passing the Id of record from one VF page to another in a URL parameter. In the second VF page (AddFile), I need take this Id and set it as a lookup field. I'm having troubles getting this ...
2
votes
1answer
37 views

How Do I Correctly Handling the Rendering Lifecycle of Dynamically Created Lightning Components?

Good afternoon everyone, I have a question regarding the use of the $A.createComponents() Lightning function. This may be somewhat complex so I will try to make it as clear as possible for everyone's ...
2
votes
2answers
26 views

System.AssertException not allowing me to convert Leads into Opportunities

I'm trying to convert a lead into an opportunity (on a managed package), so no access to the triggers. I just want to know if there's a solution to an Assertion Failed. This is part of the Error ...
1
vote
0answers
24 views

Sending values to a custom controller wrapper

I am attempting to pass value from an inputField to a custom controller Wrapper, and my values are coming across null ('Attempt to de-reference a null object'), When I try to assign them to my ...
2
votes
1answer
54 views

Passing Record ID param from one VF Page to another in the URL

Background I'm working with two VF pages, OutOfOffice and AddNewOutOfOffice. The OutOfOffice page displays a list of custom object records. For each record there is an edit and a delete button. ...
0
votes
0answers
17 views

how to copy the excel sheet values into vf page

i have 3 fields model,version,discount.the 3 fields in excel sheet also.once i enter the values in excel sheet,these excel sheet values automatically saved in panelgrid(visualforce page).the panelgrid ...
0
votes
3answers
35 views

Displaying Record/Fields on VF Page Load

On the load of a VF page, I want to query for a record and then display certain fields from that record on the page. Controller: public with sharing class SS_ObjectController { public ...
0
votes
1answer
43 views

How to insert a record using table?

I have a table of 3 rows and 3 columns in which the data I enter should be saved in the account object. But what I am facing is , only the 3rd row data is inserted not the first two. My controller ...
0
votes
3answers
50 views

What exactly the getter and setter method does? [duplicate]

How and why getter adn setter methods are used in apex? For Ex: What does this line of code does? Public String companyname{get;set;} And where in your code these methods be ideally used?
2
votes
1answer
51 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
22 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
49 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
48 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
20 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
23 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
21 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
24 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
39 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
55 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
29 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
13 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
119 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
41 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
35 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
49 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
19 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
29 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
56 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
37 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
46 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
30 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
25 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
45 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
88 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
61 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
37 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
54 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
56 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 ...