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
votes
1answer
13 views

execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object

Here is my very super simple code and what I'm trying to do is returning the Id... that's all I'm doing. Getting the following error: Apex trigger test caused an unexpected exception, contact ...
1
vote
1answer
14 views

How do I simulate a checkbox click on a Visualforce page from a Controller class?

I have a Visualforce page with a header section that has a checkbox, and a detail section with a table that has a checkbox in the first column. Based on the data loaded the checkboxes in the table are ...
0
votes
1answer
24 views

how to get the Id from the list of records if user update a value for one objet on the list in visualforce page?

If i am updating a value of a list of records : suppose 1. first there is a list of opportunity 2. after clicking any opportunity , oppli list will show 3. now i can update sales price of each ...
0
votes
0answers
30 views

Trigger either a visualforce page or button when field hits a value [on hold]

I am using Avatax and we have a trigger that populates our freight amount to the opportunity line item after the it has been submitted for approval. Problem is that calculate tax is a button that ...
1
vote
3answers
54 views

Salesforce & Visualforce

I am a newbie to salesforce and hence unable to understand this code block. Can anyone help me to understand controller code? Controller Code : public class AddmultipleAccountsController { ...
0
votes
1answer
13 views

Using Input Field to occupy Output Field through Extensions Class

M a SF rookie and i need the output fields ie Amount,Price and Quantity to be displayed when their respective Product is selected.All are fields of an Sobject known as Sales_Order_Line_Item__c.The ...
0
votes
2answers
36 views

Can't create a page for testing

I'm trying to create a page in my test class like this: PageReference pageRef = Page.testPage; Test.setCurrentPage(pageRef); But I'm getting an error: Compilation error: Page testPage does ...
2
votes
1answer
39 views

Sharing Controller with a Visualforce Page and Visualforce Email Template

I have a Visualforce page with a custom controller that presents sales data in a simple table. The users would now like to email that data. So I'm trying to leverage the same controller for both the ...
0
votes
0answers
27 views

DIsplay data from one form to another in salesforce

I have to make two forms on same vf page. My requirement is to populate the data entered in the first form to data fields in the second form(Both forms have same fields). How can I do it? Help me with ...
8
votes
1answer
82 views

How to redirect Visualforce page automatically

I have custom button which when clicked redirects to VF page, VF page calls some controller, But I want as soon as custom button is clicked it should process to VF page waits for 2 secs and then ...
2
votes
1answer
35 views

Unit Test for Controller that Calls a Flow

I have a controller that initiates a flow when a button is clicked on a lead. I understand that unit test classes cannot make web callouts, so I have created a class that implements the ...
3
votes
1answer
31 views

Display List of Objects in a VF page not working as expected

To put you on perspective, I've created a Detail Page Button that displays in a new window some result data from a callout to a SOAP web service. The thing is, I've tried it in a sanbox, and it works ...
2
votes
2answers
30 views

list of records via custom controller

I'm using following simple code to get list of Account via custom controller but it is not returning records.what I'm doing wrong ? <apex:page controller="listcontroller" > <apex:Form > ...
0
votes
1answer
50 views

Filter on recordType values

We need two separate tabs based on the same standard object. As salesforce doesn't support my requirement using standard configuarion, have created simple VF page and defined a tab. But as both the ...
3
votes
2answers
89 views

Saving Opportunity and related Contact from single Visualforce page

I have created a visualforce page that displays both opportunity and contact fields that I want users to be able to edit and save. I am using the opporutnity standard controller and added the ...
3
votes
1answer
23 views

Unable to set controller extensions property with component attribute

I tried setting "accType" property in this extension class with "Customer - Direct". But it is not getting set or getting set as NULL. My VF Page <apex:page standardcontroller="Account" ...
1
vote
1answer
42 views

apex param in apex repeat (pass parameter to controller in repeat) not working

I have an apex:repeat and I want to use and apex:param in it. The repeater shows the userName of the person who liked the feed (like.user.Name). And if this userName is same as the person who has ...
1
vote
0answers
19 views

Custom Clone button with ability to validate picklist values for Record Types

We have a custom controller for a custom clone button that also checks whether the picklist values are active on a parent record when a Case is being cloned. If any of the picklist values on the ...
-3
votes
1answer
45 views

Rollup Summary Fields and Formula Fields are not writable but how to call them in test class

Can any one help me out with test class code coverage .I have written a test class for a controller having wrapper class and their are rollup summary and formula fields which are not writable but how ...
1
vote
1answer
55 views

Test class fails throws different types of error as :STANDARD_PRICE_NOT_DEFINED, No standard price defined for this product

Can any one help me out with test class code coverage .I have written a test class for a controller having wrapper class,but the code covearage is zero. Any help very much appreciated. Different ...
0
votes
0answers
32 views

Test class for a controller having wrapper class,code coverage appears Zero

Can any one help me out with test class code coverage .I have written a test class for a controller having wrapper class,but the code covearage in the test class appears Zero and the overall code ...
8
votes
4answers
357 views

Apex Controllers: What do the get; set; do?

I've built a few apex controllers, and like most people have copied some code from here and there. In the controllers, there's typically an expression that looks like the following: public *var type* ...
1
vote
2answers
41 views

How to call a controller extension from java script

I'm creating a Visual Force page that enables user to add Case Comments. I am using javascript to create the comment and then I am using a controller extension to insert it. How can I call the method? ...
1
vote
1answer
52 views

Passing parameter from component to controller through ActionFunction

I would like to pass a parameter from my component to the controller. Here is the source code: <apex:actionFunction name="attachFil" action="{!attachFile}"> <apex:param ...
0
votes
0answers
16 views

Removing amp; on Metatag

I'm using Facebook share function on my website. However, I'm having issues with displaying my product image on FB. The URL link that FB scraper sees contains double amp;amp;. I would like to remove ...
0
votes
3answers
77 views

how to get value from drop down to the controller using apex SelectOption?

Controller Code - public class ApplicationController { public String selectedApplicationId {get;set;} public static List<SelectOption> applicationOptions { get { ...
0
votes
0answers
37 views

Trigger for a visual force page which has controller

Can I write an trigger for a visual force page which has controller? I have a Visualforce page created on Opportunity object which is in PDF format. I have a few RollUp summary fields created on ...
0
votes
0answers
21 views

Total does not get displayed in a visual force page

Can any on help me out how to get the total display for the quarter in a visual force page which is in a PDF format .The Column count is not getting display for any quarters.Any help very much ...
1
vote
0answers
30 views

passing html passthrough from apex to selectoptions

I'm trying to pass through some additional information via the html- passthrough on apex:selectoptions from the controller. Ie I need it to output: <apex:selectOption html-data-range="h" ...
1
vote
0answers
26 views

Attachment Parentid population

I have two VF Pages. Say V1 , V2 where V1 is my parent page and V2 is included in it. Here in V1 an instance of a custom object (Call) is created and in DML insert it gets into the system. In V2 ...
0
votes
1answer
30 views

Updating custom lookup value from controller

I have been struggling with this problem for awhile and appreciate any help or suggestions to resolve this In my ORDERS I have added a custom field "ClassTeacher_c", this is a custom lookup field ...
0
votes
2answers
85 views

How to show error message on standard detail page from apex controller?

I have a button called Sync on Order object. I want to sync only those orderlineitems whose IsSynced field has value as 'No'. If there are no such orderlineitems then i want to display a message on ...
0
votes
1answer
32 views

Passing Parameter from JavaScirpt to controller don't seem to work

I'm trying to send a parameter from Visual force page to controller to delete the row of record on pagetable via javascript using actionFunction. I'm able to get the alert messages from javascript ...
0
votes
3answers
56 views

Controller extension variable visibility question

I don't know how to put this question, so I will just start with the code I have: MyController.cls global with sharing class MyController { public String variableOne{get;set;} public ...
0
votes
0answers
42 views

Apex Code Logic written to change the value in visualforce page doesnot work

Can any one help me on this? I have a Visualforce page created on Opportunity object which is in PDF format. I have a few RollUp summary fields created on opportunity object. There is a Wrapper class ...
1
vote
0answers
20 views

Relationship between page and controller

Is it advisable to have multiple pages for 1 controller? Like for each Visualforce Page, they only have minimal process just like initializations only. For example: I have Apex Class ...
0
votes
0answers
39 views

How to display a popup only when a record is created and not edited?

I am trying to show the user a popup only when the record is created. For every subsequent edit and save, the popup shouldn't be displayed. I have created 2 VF pages and 2 controllers so far and now ...
1
vote
3answers
40 views

Inserting a record with Lookup value

I'm trying to insert a custom object record which contains various custom fields and also a lookup field. Is it possible to insert the record without specifying the lookup field value? I've tried ...
1
vote
1answer
24 views

Error: Unknown constructor 'DuplicateQARelController.DuplicateQARelController()

Can anyone please help me figure out why I'm getting the error mentioned in the thread title? I'm trying to build a simple VF page with a custom controller. VF page: <apex:page ...
-1
votes
1answer
37 views

variable set by VF page is not accessible in another method in Controller

I am setting a variable from VF page by using Javascript Remoting Action and the same variable when I am trying to access from a different method in Controller it always says NULL. The below code ...
1
vote
0answers
17 views

Based on the product name ,split data with year and get the column count in visual force page pdf [duplicate]

Can any on help me out how to get the Data split based on the year , product name and get the column count in a visual force page which is in a PDF format . With Code i could retrive the data ...
-1
votes
1answer
82 views

column count in visual force page pdf

Can any on help me out how to get the column count in a visual force page which is in a PDF format . ProductName Q1 Q2 Q3 Q4 Total BXRC-25e4000-F-04 100 200 300 ...
0
votes
1answer
32 views

How can you associate multiple standard list controller with a visualforce page

Good afternoon, We have a visualforce page that allows us to add multiple contacts at once from a account view. When we add these I would like to be able to associate these contacts with a campaign ...
2
votes
1answer
27 views

Where Statement issue with SOQL, after upgrade

Not sure what happened but I had the following Custom Controller working just great until recently. Not sure if it was the recent release or if I just completely missed the fact that it wasn't ...
0
votes
1answer
52 views

Row count in a visual force page pdf

Can any on help me out how to get the Row count in a visual force page which is in a PDF format . ProductName Q1 Q2 Q3 Q4 Total BXRC-25e4000-F-04 100 200 300 ...
1
vote
1answer
62 views

Use “accesskey” attribute of apex:commandbutton in VF page

I am trying to implement a functionality that would allow users to invoke controller method by pressing "enter" key also. I know "accesskey" attribute of apex:commandbutton can be used to perform such ...
0
votes
1answer
24 views

Map<String, Object> from controller accessing the inner object

Having and data returned from api like this: { "result": true, "retData": { "CATEGORY_A": { "MEALS": { "price": "", ...
0
votes
0answers
15 views

What is an Ancestor Method?

I have a leadConvertController that is tied to several components and other controllers. One line keeps giving me a Method does not override an ancestor method. I don't even know where to start to fix ...
1
vote
3answers
45 views

Can we create visualforce page without any controller

Actaully I am new to salesforce . i want to create new visualforce page without any standard or controller in that page . this page should get only user name and user profile in single page. Could ...
0
votes
0answers
13 views

Update case field with timestamp when logCallPublisher is being used

I have a VF page setup to use logcall publisher that starts with - <apex:page standardController="Case"> <apex:logCallPublisher entityId="{!case.id}" I'm trying to update a case field ...